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

91 lines
3.8 KiB
HTML
Raw Normal View History

2022-04-09 01:36:05 +02:00
{{ define "title" }}
2022-05-06 11:49:30 +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" }}
2022-06-12 13:50:06 +02:00
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
{{ end }}
{{ end }}
{{ define "add_content" }}
2022-04-09 21:34:04 +02:00
{{- $pages := where .Site.RegularPages "Permalink" "!=" .Permalink -}}
2022-04-10 02:24:33 +02:00
{{- $paginator := "" -}}
2022-05-06 11:49:30 +02:00
{{- $partial := .Layout -}}
{{- $paginate := true -}}
2022-06-07 13:36:28 +02:00
{{- if eq .Layout "gen_list" -}}
2022-04-10 00:53:31 +02:00
{{ if eq .Section "events" }}
{{- $pages = where $pages ".Params.when" "ne" nil -}}
{{ else if eq .Type "about" }}
2022-06-07 13:36:28 +02:00
{{- $pages = (where $pages ".Params.about" "=" true) -}}
2022-04-10 00:53:31 +02:00
{{ else if eq .Section "news" }}
{{- $pages = .Data.Pages -}}
{{ else if eq .Section "featured" }}
{{- $pages = where $pages ".Params.featured" "=" true -}}
2022-05-06 13:29:00 +02:00
{{ else if eq .Section "recurrent" }}
{{- $pages = where $pages ".Params.recurrent" "=" true -}}
2022-04-10 00:53:31 +02:00
{{ end }}
2022-06-13 04:08:02 +02:00
{{ else if eq .Layout "links" -}}
{{- $pages = .Data.Pages -}}
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-06-07 13:36:28 +02:00
{{ $partial = "gen_list" }}
2022-04-28 14:53:58 +02:00
{{ else if eq .Kind "taxonomy" }}
2022-05-06 11:49:30 +02:00
{{ $paginate = false }}
{{- $pages = .Data.Terms.ByCount -}}
{{ $partial = "tags_n_categories" }}
2022-04-10 00:53:31 +02:00
{{ end }}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-05-06 11:49:30 +02:00
{{ $partial = string (printf "layout/%s" $partial) }}
2022-06-12 16:59:25 +02:00
{{ if eq .Type "about" }}<div class="list">{{ end }}
2022-06-07 13:36:28 +02:00
{{ partial $partial (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" $paginate) }}
2022-06-12 16:59:25 +02:00
{{ if eq .Type "about" }}</div>{{ end }}
2022-05-06 11:49:30 +02:00
{{ end }}
{{ define "sidebar" }}
{{ if eq .Section "news" }}
{{ if gt .Site.Taxonomies.categories 0 }}
2022-05-09 21:37:34 +02:00
<aside class="sidebar">
2022-05-06 11:49:30 +02:00
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies.categories }}
{{ $orig := $taxonomyname }}
{{ if ne (i18n $taxonomyname) "" }}
{{ $taxonomyname = i18n $taxonomyname }}
{{ else }}
{{ $taxonomyname = $taxonomyname | humanize }}
{{ end }}
<div class="align_menu"><a href="{{ "categories/" | relLangURL}}{{ $orig | urlize }}">{{ $taxonomyname }}</a></div>
{{ end }}
2022-05-09 21:37:34 +02:00
</aside>
2022-05-06 11:49:30 +02:00
{{ end }}
2022-06-12 13:50:06 +02:00
{{ else if or (eq .Section "events") (eq .Section "recurrent") }}
2022-05-06 11:49:30 +02:00
{{ if gt .Site.Taxonomies.events 0 }}
2022-05-09 21:37:34 +02:00
<aside class="sidebar">
2022-05-06 11:49:30 +02:00
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
2022-05-09 21:37:34 +02:00
<div class="align_menu"><a href="{{ "recurrent/" | relLangURL}}">{{ i18n "recurrent" }}</a></div>
2022-05-06 11:49:30 +02:00
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies.events }}
{{ $orig := $taxonomyname }}
{{ if ne (i18n $taxonomyname) "" }}
{{ $taxonomyname = i18n $taxonomyname }}
{{ else }}
{{ $taxonomyname = $taxonomyname | humanize }}
{{ end }}
<div class="align_menu"><a href="{{ "events/" | relLangURL}}{{ $orig | urlize }}">{{ $taxonomyname }}</a></div>
{{ end }}
2022-05-09 21:37:34 +02:00
</aside>
2022-05-06 11:49:30 +02:00
{{ end }}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-04-09 01:36:05 +02:00
{{ end }}