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

36 lines
1.3 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) }}
2022-05-06 14:43:24 +02:00
2022-04-08 15:02:22 +02:00
{{ $featured := where (where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections) ".Params.Lastmod" "gt" (now.AddDate 0 0 $days) }}
2022-05-06 14:43:24 +02:00
{{ $featured = where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections }}
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-09 21:37:34 +02:00
{{ $news := "news" }}
{{ if i18n $news }}
{{ $news = i18n $news }}
2022-05-06 13:29:00 +02:00
{{ end }}
2022-05-09 21:37:34 +02:00
{{ $feat := "featured" }}
{{ if i18n $feat }}
{{ $feat = i18n $feat }}
2022-05-06 11:49:30 +02:00
{{ end }}
2022-05-09 21:37:34 +02:00
<div class="two-lists">
{{ if gt (len $featured) 1 }}
{{ partial "layout/article_list" (dict "context" . "pages" $featured "amount" "1" "title" $feat "type" "index") }}
{{ end }}
2022-05-10 04:16:08 +02:00
{{ if gt (len $posts) 1 }}
{{ partial "layout/article_list" (dict "context" . "pages" $posts "amount" "3" "title" $news "type" "index") }}
{{ end }}
2022-05-06 13:29:00 +02:00
</div>
2022-05-06 11:49:30 +02:00
{{ end }}
{{ define "sidebar" }}
{{ "" }}
{{ end }}