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

44 lines
1.7 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 -}}
2022-04-10 00:53:31 +02:00
{{ $partial := "" }}
2022-04-09 21:34:04 +02:00
{{ $title := "" }}
{{ $pic := "true" }}
2022-04-28 14:53:58 +02:00
{{ $pre := "layout" }}
2022-04-10 02:24:33 +02:00
{{- $paginator := "" -}}
2022-04-10 00:53:31 +02:00
{{ $part := .Layout }}
{{ $partial_before := "" }}
2022-04-10 11:18:04 +02:00
{{ $paginate := false }}
2022-04-10 00:53:31 +02:00
{{ if eq .Layout "article_list" }}
2022-04-10 11:18:04 +02:00
{{ $paginate = true }}
2022-04-10 00:53:31 +02:00
{{ 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 }}
2022-04-09 21:34:04 +02:00
{{ else }}
2022-04-10 00:53:31 +02:00
{{ if eq .Kind "term" }}
{{- $pages = .Data.Pages -}}
2022-04-10 02:24:33 +02:00
{{ $part = "article_list" }}
2022-04-28 14:53:58 +02:00
{{ else if eq .Kind "taxonomy" }}
2022-04-10 00:53:31 +02:00
{{- $pages = .Data.Terms.Alphabetical -}}
2022-04-10 02:24:33 +02:00
{{ $part = "tags_n_categories" }}
2022-04-10 00:53:31 +02:00
{{ end }}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-04-10 02:24:33 +02:00
{{ if eq $paginate true}}
{{- $paginator = .Paginate $pages -}}
{{ end }}
2022-04-10 00:53:31 +02:00
{{ if and $pre $part }}
{{ $partial := string (printf "%s/%s" $pre $part) }}
2022-04-10 11:18:04 +02:00
{{ partial $partial (dict "context" . "paginator" $paginator "pages" $pages "amount" "5" "title" $title "content" .Content "pic" $pic "type" .Type "partial_before" $partial_before "paginate" $paginate) }}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-04-09 01:36:05 +02:00
{{ end }}