{{- define "title" -}} {{- $name := .Name -}} {{- if lower $name | i18n -}} {{- $name = lower $name | i18n -}} {{- end -}} {{- $name | humanize -}} {{- end -}} {{- define "main" -}} {{- $paginator := slice -}} {{- if eq .Section "events" -}} {{- $paginator = .Paginate (where site.RegularPages.ByLastmod.Reverse ".Params.when" "ne" nil) -}} {{- else if eq .Section "news" }} {{- $paginator = .Paginate (where (where .Site.RegularPages.ByLastmod.Reverse "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.mainSections) }} {{- else -}} {{- $paginator = .Paginate .RegularPagesRecursive.ByLastmod.Reverse -}} {{- end -}} {{- range first 5 $paginator.Pages -}}

{{- .Title -}}

{{ if and (ne .Params.when "") (ne .Params.when nil) }}
{{ .Params.when }}
{{ end }} {{ if and (ne .Params.price "") (ne .Params.price nil) }} {{ if eq .Params.price "free" }}
Der Eintritt ist frei.
{{ else }}
Eintritt: {{ .Params.price }}
{{ end }} {{ end }}
{{- if .Resources.ByType "image" -}}
{{- $pic := index (.Resources.ByType "image") 0 -}} {{- $thumb := $pic.Resize "1024x" }}
{{- end }}
{{- if .Params.description -}} {{- .Params.description -}} {{- else -}} {{- .Summary -}} {{- end }} {{ if .Truncated }}
{{- i18n "readmore" -}}..
{{ end }}
{{- end }} {{- end -}} {{ define "nav2" }}

{{ $true := false }} {{ range $taxonomyname, $taxonomy := where .Site.Taxonomies.categories ".Page.Section" .Section }} {{ if ne $taxonomyname nil }} {{ $true = true }} {{ end }} {{ end }} {{ if $true }} {{ range $taxonomyname, $taxonomy := where .Site.Taxonomies.categories ".Page.Section" .Section }} {{ $taxonomyname | humanize }} {{ end }} {{ end }} {{ partial "sidebar.html" . }}

{{ end }} {{ define "sidebar" }} {{- partial "sidebar" . }} {{ end }}