forked from Bunteshaus/bunteshaus.de
47 lines
1.5 KiB
HTML
47 lines
1.5 KiB
HTML
{{- 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 }}
|
|
<h1>{{ $name }}</h1>
|
|
{{- end -}}
|
|
|
|
{{- define "main" -}}
|
|
{{ if site.Params.debug }}taxonomy.html{{ end }}
|
|
{{ $title := lower .Title }}
|
|
{{- $paginator := slice -}}
|
|
{{ $partial := "contentlayouts/list.html" }}
|
|
{{ $what := printf ".Params.%s" $title }}
|
|
|
|
{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
|
|
|
|
{{ if or (eq $title "about") (eq $title "featured") }}
|
|
{{- $paginator = .Paginate (where $posts $what "eq" true) -}}
|
|
{{ else if or (eq $title "tags") (eq $title "categories") }}
|
|
{{- $paginator = .Paginate $posts -}}
|
|
{{ $partial = "contentlayouts/termlist.html" }}
|
|
{{ else if eq $title "events" }}
|
|
{{- $paginator = .Paginate (where $posts ".Params.when" "ne" nil) -}}
|
|
{{ else }}
|
|
{{- $paginator = .Paginate .Data.Pages -}}
|
|
{{ end }}
|
|
{{ if eq $paginator.PageNumber 1 }}
|
|
{{ if ne .Content "" }}
|
|
<article>
|
|
{{ .Content }}
|
|
</article>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ partial $partial (dict "context" . "paginator" $paginator "amount" "5") }}
|
|
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
|
|
{{- end -}}
|
|
|
|
{{ define "sidebar" }}
|
|
{{- partial "contentlayouts/menu.html" . }}
|
|
{{ end }}
|