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

44 lines
1.7 KiB
HTML

{{ define "title" }}
<h1>{{ if .Title }}{{ .Title }}{{ else }}{{ if i18n .Section }}{{ i18n .Section }}{{ else }}{{ .Section }}{{ end }}{{ end }}</h1>
{{ end }}
{{ define "content" }}
{{ partial "debug" (dict "context" . "caller" "list.html")}}
{{- $pages := where .Site.RegularPages "Permalink" "!=" .Permalink -}}
{{ $partial := "" }}
{{ $title := "" }}
{{ $pic := "true" }}
{{ $pre := "layout" }}
{{- $paginator := "" -}}
{{ $part := .Layout }}
{{ $partial_before := "" }}
{{ $paginate := false }}
{{ if eq .Layout "article_list" }}
{{ $paginate = true }}
{{ if eq .Section "events" }}
{{- $pages = where $pages ".Params.when" "ne" nil -}}
{{ else if eq .Type "about" }}
{{- $pages = where $pages ".Params.about" "=" true -}}
{{ else if eq .Section "news" }}
{{- $pages = .Data.Pages -}}
{{ else if eq .Section "featured" }}
{{- $pages = where $pages ".Params.featured" "=" true -}}
{{ end }}
{{ else }}
{{ if eq .Kind "term" }}
{{- $pages = .Data.Pages -}}
{{ $part = "article_list" }}
{{ else if eq .Kind "taxonomy" }}
{{- $pages = .Data.Terms.Alphabetical -}}
{{ $part = "tags_n_categories" }}
{{ end }}
{{ end }}
{{ if eq $paginate true}}
{{- $paginator = .Paginate $pages -}}
{{ end }}
{{ if and $pre $part }}
{{ $partial := string (printf "%s/%s" $pre $part) }}
{{ partial $partial (dict "context" . "paginator" $paginator "pages" $pages "amount" "5" "title" $title "content" .Content "pic" $pic "type" .Type "partial_before" $partial_before "paginate" $paginate) }}
{{ end }}
{{ end }}