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

36 lines
1.4 KiB
HTML
Raw Normal View History

2022-04-09 01:36:05 +02:00
{{ define "title" }}
2022-04-09 21:34:04 +02:00
<h1>{{ if .Title }}{{ .Title }}{{ else }}{{ if i18n .Section }}{{ i18n .Section }}{{ else }}{{ .Section }}{{ end }}{{ end }}</h1>
2022-04-09 01:36:05 +02:00
{{ end }}
2022-04-09 21:34:04 +02:00
{{ 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) }}
2022-04-09 01:36:05 +02:00
{{ end }}