Hack in a featured post doodad.

Very manual currently :p
This commit is contained in:
2021-04-27 16:43:00 +01:00
parent f9b0b6d447
commit eeaef77a40
3 changed files with 98 additions and 0 deletions

88
layouts/home.html Normal file
View File

@@ -0,0 +1,88 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "title" -}}
{{ .Site.Title }}
{{- end }}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1 itemprop="name"><em>{{ .Title }}</em></h1>
</header>
<div style="position: relative;">
<img class="full-width" src="/img/nikko-macaspac-6SNbWyFwuhk-unsplash.jpg"/>
<div style="position: absolute; top: 0;">
<h1 itemprop="name" >
<a href="/post/2018/06/fuck-the-world">Featured Post: "Fuck The World"</a>
</h1>
<h2>Let me tell you a little secret I learned. There is one fundamental truth. One truth in this maelstrom. In universal entropy one thing remains…</h2>
</div>
<nav class="readmore" style="position: absolute; bottom: 40px; right: 0; font-size: 1em; padding: 1em; border: 1px solid var(--primary);">
<a itemprop="url" href="/post/2020/12/52stories/">Read More&nbsp;»</a>
</nav>
</div>
{{ with .Site.Params.layout.home.section }}
{{ if ne $.Site.Params.hackcss.disabled true }}
{{ with resources.Get "css/conditional/layouts/partials/page-thumbs.css" | minify }}
<style>{{ .Content | safeCSS }}</style>
{{ end }}
{{ end }}
{{ range sort . "weight" "asc" }}
<section>
{{ $index := site.GetPage "section" .type }}
{{ $pages := where site.RegularPages "Type" .type }}
{{ $page_count := (default 1 (len $pages)) }}
{{ if eq $page_count 1 }}
{{ partial "page-summary.html" $index }}
{{ else if gt $page_count 1 }}
<header>
<h1 itemprop="name">
<a href="{{ $index.RelPermalink }}">Recent {{ $index.Title }}</a>
</h1>
<blockquote itemprop="description">{{ $index.Description }}</blockquote>
</header>
{{ partial "page-thumbs.html" (dict "thumbnail_options" .thumbs "page_count" $page_count "limit" .limit "pages" $pages) }}
{{ end }}
{{ if and (lt .limit $page_count) (ne 1 $page_count) }}
<nav class="readmore">
<a itemprop="url" href="{{ $index.RelPermalink }}">
View more {{ $index.Title }}
</a>
</nav>
{{ end }}
</section>
{{ end }}
{{ end }}
{{ if not .Site.Params.layout.home.hide_blog }}
<section itemscope itemtype="https://schema.org/Blog">
{{ range (.Paginate (where .Site.RegularPages "Type" "in" (site.Params.layout.homepage.sections | default (slice "post")))).Pages }}
{{ partial "page-summary.html" . }}
{{ end }}
</section>
{{ end }}
{{ end }}
{{ define "footer" }}
{{ if not .Site.Params.layout.home.hide_blog }}
<p>{{ partial "pagination.html" . }}</p>
{{ end }}
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ end }}