2021-10-23 22:20:01 +02:00
|
|
|
{{- define "title" -}}
|
2022-03-27 15:10:18 +02:00
|
|
|
{{ $name := .Name | lower }}
|
2022-03-27 14:24:21 +02:00
|
|
|
{{ if ne ($name | i18n) "" }}
|
|
|
|
{{ $name = $name | i18n }}
|
2022-03-27 15:10:18 +02:00
|
|
|
{{ else }}
|
|
|
|
{{ if ne .Section "events" }}
|
|
|
|
{{ $name = $name | singularize }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $name = $name | humanize }}
|
2022-03-27 14:24:21 +02:00
|
|
|
{{ end }}
|
2022-04-05 14:49:37 +02:00
|
|
|
<h1>{{ $name }}</h1>
|
2021-10-23 22:20:01 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- define "main" -}}
|
2022-04-05 20:58:02 +02:00
|
|
|
{{ $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.searchSections) $what "eq" true) -}}
|
|
|
|
{{ else if eq $title "events" }}
|
|
|
|
{{- $paginator = .Paginate (where (where .Site.RegularPages "Type" "in" site.Params.searchSections) ".Params.when" "ne" nil) -}}
|
|
|
|
{{ 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 "contentlayouts/list.html" . }}
|
|
|
|
{{- end }}
|
|
|
|
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
|
2021-10-23 22:20:01 +02: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-03-26 20:28:14 +01:00
|
|
|
{{ end }}
|