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

41 lines
1.5 KiB
HTML
Raw Normal View History

2021-10-23 22:20:01 +02:00
{{ define "title" }}
2022-04-05 15:47:23 +02:00
{{ if .Content }}
<h1>{{ .Title }}</h1>
{{ end }}
2021-10-23 22:20:01 +02:00
{{ end }}
{{ define "main" }}
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 "" }}
<article>
{{ .Content }}
</article>
2022-04-08 13:22:50 +02:00
{{ end }}
{{ if gt (len $featured) 0 }}
<a href="/featured"><h2>{{if "featured" | i18n }}{{ "featured" | i18n }}{{ else }}{{ "Featured" }}{{ end }}</h2></a>
2022-04-08 14:42:30 +02:00
{{ partial "contentlayouts/list.html" (dict "context" . "pages" $featured "amount" "3" ) }}
2022-04-08 13:22:50 +02:00
{{ end }}
2022-03-27 16:47:39 +02:00
{{ end }}
2022-04-08 13:22:50 +02:00
{{ if gt (len $posts) 1 }}
<a href="/news"><h2>{{ if "news" | i18n }}{{ "news" | i18n }}{{ else }}{{ "News" }}{{ end }}</h2></a>
2022-04-08 14:42:30 +02:00
{{ partial "contentlayouts/list.html" (dict "context" . "paginator" $paginator "amount" "5") }}
2022-04-07 16:31:15 +02:00
2022-04-08 13:22:50 +02:00
<div id="pagination_outer" style="display: flex; justify-content: center;">
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
</div>
{{ end }}
2022-03-26 19:22:14 +01:00
2022-03-27 16:47:39 +02:00
2022-03-26 19:22:14 +01:00
{{ end }}
2022-03-26 20:28:14 +01:00
{{ define "sidebar" }}
2022-04-05 20:58:02 +02:00
{{- partial "contentlayouts/menu.html" . }}
2022-04-03 21:08:42 +02:00
{{ end }}