bunteshaus.de/themes/buha/layouts/index.html
2022-04-08 12:04:46 +02:00

39 lines
1.1 KiB
HTML

{{ define "title" }}
{{ if .Content }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ end }}
{{ define "main" }}
{{ partial "rrule" . }}
{{ $s := .Site.Params }}
{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.searchSections }}
{{- $featured := where (where $posts ".Params.featured" "=" true) "Type" "in" $s.searchSections }}
{{- $paginator := .Paginate $posts -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
<a href="/featured"><h2>{{ "featured" | T }}</h2></a>
{{ partial "contentlayouts/list.html" (dict "context" . "pages" $featured "amount" "3" "max_age" "3" "featured" "true") }}
{{ end }}
<a href="/news"><h2>{{ "news" | T }}</h2></a>
{{ partial "contentlayouts/list.html" (dict "context" . "paginator" $paginator "amount" "5" "max_age" "-14") }}
<div id="pagination_outer" style="display: flex; justify-content: center;">
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
</div>
{{ end }}
{{ define "sidebar" }}
{{- partial "contentlayouts/menu.html" . }}
{{ end }}