forked from Bunteshaus/bunteshaus.de
81 lines
3.4 KiB
HTML
81 lines
3.4 KiB
HTML
{{ define "title" }}
|
|
<h1>{{ if .Title }}
|
|
{{ .Title }}
|
|
{{ else }}
|
|
{{ if i18n .Section }}
|
|
{{ i18n .Section }}
|
|
{{ else }}
|
|
{{ .Section }}
|
|
{{ end }}
|
|
{{ end }}</h1>
|
|
{{ end }}
|
|
|
|
{{ define "content" }}
|
|
{{- $pages := where .Site.RegularPages "Permalink" "!=" .Permalink -}}
|
|
{{- $paginator := "" -}}
|
|
{{- $partial := .Layout -}}
|
|
{{- $paginate := true -}}
|
|
{{- if eq .Layout "article_list" -}}
|
|
{{ 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 -}}
|
|
{{ else if eq .Section "recurrent" }}
|
|
{{- $pages = where $pages ".Params.recurrent" "=" true -}}
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ if eq .Kind "term" }}
|
|
{{- $pages = .Data.Pages -}}
|
|
{{ $partial = "article_list" }}
|
|
{{ else if eq .Kind "taxonomy" }}
|
|
{{ $paginate = false }}
|
|
{{- $pages = .Data.Terms.ByCount -}}
|
|
{{ $partial = "tags_n_categories" }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ $partial = string (printf "layout/%s" $partial) }}
|
|
|
|
{{ partial $partial (dict "context" . "pages" $pages "amount" "5" "content" .Content "type" .Type "paginate" $paginate) }}
|
|
{{ end }}
|
|
|
|
{{ define "sidebar" }}
|
|
{{ if eq .Section "news" }}
|
|
{{ if gt .Site.Taxonomies.categories 0 }}
|
|
<aside class="sidebar">
|
|
<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 }}
|
|
</aside>
|
|
{{ end }}
|
|
{{ else if eq .Section "events" }}
|
|
|
|
{{ if gt .Site.Taxonomies.events 0 }}
|
|
<aside class="sidebar">
|
|
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
|
|
<div class="align_menu"><a href="{{ "recurrent/" | relLangURL}}">{{ i18n "recurrent" }}</a></div>
|
|
{{ 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 }}
|
|
</aside>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|