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

27 lines
1.1 KiB
HTML
Raw Normal View History

2022-04-09 21:34:04 +02:00
{{ define "content" }}
2022-04-08 14:44:17 +02:00
{{- $all := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
2022-04-08 15:02:22 +02:00
{{ $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) }}
2022-04-08 14:42:30 +02:00
{{ $featured = $all | intersect $featured }}
{{ $posts := $all | complement $featured }}
2022-05-06 13:29:00 +02:00
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
2022-04-08 13:22:50 +02:00
{{ end }}
2022-05-06 13:29:00 +02:00
<div style="display: flex; flex-wrap: wrap;">
{{ if gt (len $featured) 1 }}
2022-05-06 14:39:53 +02:00
<section class="index_section">
2022-05-06 13:29:00 +02:00
{{ partial "layout/article_list" (dict "context" . "pages" $featured "amount" "5" "title" "Featured") }}
</section>
{{ end }}
{{ if gt (len $posts) 1 }}
2022-05-06 14:39:53 +02:00
<section class="index_section">
2022-05-06 13:29:00 +02:00
{{ partial "layout/article_list" (dict "context" . "pages" $posts "amount" "5" "title" "News") }}
</section>
2022-05-06 11:49:30 +02:00
{{ end }}
2022-05-06 13:29:00 +02:00
</div>
2022-05-06 11:49:30 +02:00
{{ end }}
{{ define "sidebar" }}
{{ "" }}
{{ end }}