bunteshaus.de/themes/buha/layouts/index.html

27 lines
1.1 KiB
HTML

{{ define "content" }}
{{- $all := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
{{ $days := int (mul (mul (int .Site.Params.featured_expire) 7) -1) }}
{{ $featured := where (where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections) ".Params.Lastmod" "gt" (now.AddDate 0 0 $days) }}
{{ $featured = $all | intersect $featured }}
{{ $posts := $all | complement $featured }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
{{ end }}
<div style="display: flex; flex-wrap: wrap;">
{{ if gt (len $featured) 1 }}
<section style="width: 40%;">
{{ partial "layout/article_list" (dict "context" . "pages" $featured "amount" "5" "title" "Featured") }}
</section>
{{ end }}
{{ if gt (len $posts) 1 }}
<section style="width: 40%;">
{{ partial "layout/article_list" (dict "context" . "pages" $posts "amount" "5" "title" "News") }}
</section>
{{ end }}
</div>
{{ end }}
{{ define "sidebar" }}
{{ "" }}
{{ end }}