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

25 lines
1.1 KiB
HTML
Raw Normal View History

2021-10-23 22:20:01 +02:00
{{ define "title" }}
2022-04-09 21:34:04 +02:00
<h1>{{ .Title }}</h1>
2021-10-23 22:20:01 +02:00
{{ end }}
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-04-07 16:31:15 +02:00
{{- $paginator := .Paginate $posts -}}
2022-03-27 16:47:39 +02:00
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
2022-04-09 21:34:04 +02:00
{{ partial "snippets/content" (dict "content" .Content) }}
2022-04-08 13:22:50 +02:00
{{ end }}
2022-04-10 00:53:31 +02:00
{{ partial "l1/article_list" (dict "context" . "pages" $featured "amount" "3" "title" "Featured") }}
2022-03-27 16:47:39 +02:00
{{ end }}
2022-04-08 13:22:50 +02:00
{{ if gt (len $posts) 1 }}
2022-04-10 00:53:31 +02:00
{{ partial "l1/article_list" (dict "context" . "paginator" $paginator "amount" "5" "title" "News") }}
2022-04-08 13:22:50 +02:00
<div id="pagination_outer" style="display: flex; justify-content: center;">
2022-04-09 21:34:04 +02:00
{{ partial "snippets/paginator" (dict "paginator" $paginator) }}
2022-04-08 13:22:50 +02:00
</div>
{{ end }}
2022-03-26 19:22:14 +01:00
{{ end }}