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

41 lines
1.2 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 }}
2022-04-05 14:49:37 +02:00
<h1>{{ $name }}</h1>
2022-04-03 21:08:42 +02:00
{{- end -}}
{{- define "main" -}}
{{ $title := lower .Title }}
{{ $s := .Site.Params }}
{{- $paginator := slice -}}
{{ $what := printf ".Params.%s" $title }}
{{ if or (eq $title "about") (eq $title "featured") }}
2022-04-04 12:44:19 +02:00
{{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.searchSections) $what "eq" true) -}}
2022-04-03 21:08:42 +02:00
{{ else if eq $title "events" }}
2022-04-04 12:44:19 +02:00
{{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.searchSections) ".Params.when" "ne" nil) -}}
2022-04-03 21:08:42 +02:00
{{ else }}
{{- $paginator = .Paginate .Data.Pages -}}
{{ end }}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
2022-04-05 20:58:02 +02:00
{{ partial "contentlayouts/list.html" . }}
2022-04-03 21:08:42 +02:00
{{- end }}
2022-04-04 03:35:13 +02:00
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
2022-04-03 21:08:42 +02:00
{{- end -}}
{{ define "sidebar" }}
2022-04-05 20:58:02 +02:00
{{- partial "contentlayouts/menu.html" . }}
2022-04-03 21:08:42 +02:00
{{ end }}