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

36 lines
1.4 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 := "layout/lists/article_list" }}
{{ $title := "" }}
{{ $pic := "true" }}
{{ if eq .Section "news" }}
{{- $pages = .Data.Pages -}}
{{ else if eq .Section "events" }}
{{- $pages = where $pages ".Params.when" "ne" nil -}}
{{ else if eq .Section "about" }}
{{- $pages = where $pages ".Params.about" "=" true -}}
{{ else if eq .Section "featured" }}
{{- $pages = where $pages ".Params.featured" "=" true -}}
{{ else if or (eq .Section "misc") (eq .Section "tools") }}
{{ $partial = "layout/lists/section_list" }}
{{ else if or (eq .Section "tags") (eq .Section "categories")}}
{{ $partial = "layout/lists/taxonomies_list" }}
{{ else }}
{{ $partial = "snippets/single_chooser" }}
{{ $pic = "false" }}
{{ end }}
{{ if eq .Kind "term" }}
{{- $pages = .Data.Pages -}}
{{ $partial = "layout/lists/term_list" }}
{{ end }}
{{ $partial := string $partial }}
{{ partial $partial (dict "context" . "pages" $pages "amount" "5" "title" $title "content" .Content "pic" $pic) }}
{{ end }}