bunteshaus.de/themes/buha/layouts/index.html
2022-05-09 21:37:34 +02:00

36 lines
1.3 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 = where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections }}
{{ $featured = $all | intersect $featured }}
{{ $posts := $all | complement $featured }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
{{ end }}
{{ $news := "news" }}
{{ if i18n $news }}
{{ $news = i18n $news }}
{{ end }}
{{ $feat := "featured" }}
{{ if i18n $feat }}
{{ $feat = i18n $feat }}
{{ end }}
<div class="two-lists">
{{ if gt (len $posts) 1 }}
{{ partial "layout/article_list" (dict "context" . "pages" $posts "amount" "3" "title" $news "type" "index") }}
{{ end }}
{{ if gt (len $featured) 1 }}
{{ partial "layout/article_list" (dict "context" . "pages" $featured "amount" "1" "title" $feat "type" "index") }}
{{ end }}
</div>
{{ end }}
{{ define "sidebar" }}
{{ "" }}
{{ end }}