bunteshaus.de/themes/buha/layouts/_default/taxonomy.html

45 lines
1.4 KiB
HTML
Raw Normal View History

2022-04-03 21:08:42 +02:00
{{- define "title" -}}
{{ $name := .Name | lower }}
{{ if ne ($name | i18n) "" }}
{{ $name = $name | i18n }}
{{ else }}
{{ if ne .Section "events" }}
{{ $name = $name | singularize }}
{{ end }}
{{ $name = $name | humanize }}
{{ end }}
{{ $name }}
{{- end -}}
{{- define "main" -}}
{{ $title := lower .Title }}
{{ $s := .Site.Params }}
{{- $paginator := slice -}}
{{ $what := printf ".Params.%s" $title }}
{{ if or (eq $title "about") (eq $title "featured") }}
{{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) $what "eq" true) -}}
{{ else if eq $title "events" }}
{{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.when" "ne" nil) -}}
{{ else if eq $title "news" }}
{{- $paginator = .Paginate .Site.RegularPages -}}
{{ else }}
{{- $paginator = .Paginate .Data.Pages -}}
{{ end }}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
{{ partial "structure/list_article" . }}
{{- end }}
<div id="pagination_outer" style="display: flex; justify-content: flex-end;">
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
</div>
{{- end -}}
{{ define "sidebar" }}
{{- partial "structure/empty" . }}
{{ end }}