{{ define "title" }}

{{ if .Title }} {{ .Title }} {{ else }} {{ if i18n .Section }} {{ i18n .Section }} {{ else }} {{ .Section }} {{ end }} {{ end }}

{{ end }} {{ define "content" }} {{ if ne .Content "" }} {{ partial "snippets/content" (dict "content" .Content) }} {{ end }} {{ end }} {{ define "add_content" }} {{- $pages := where .Site.RegularPages "Permalink" "!=" .Permalink -}} {{- $paginator := "" -}} {{- $partial := .Layout -}} {{- $paginate := true -}} {{- if eq .Layout "gen_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 = "gen_list" }} {{ else if eq .Kind "taxonomy" }} {{ $paginate = false }} {{- $pages = .Data.Terms.ByCount -}} {{ $partial = "tags_n_categories" }} {{ end }} {{ end }} {{ $partial = string (printf "layout/%s" $partial) }} {{ if eq .Type "about" }}
{{ end }} {{ partial $partial (dict "context" . "pages" $pages "content" .Content "type" .Type "paginate" $paginate) }} {{ if eq .Type "about" }}
{{ end }} {{ end }} {{ define "sidebar" }} {{ if eq .Section "news" }} {{ if gt .Site.Taxonomies.categories 0 }} {{ end }} {{ else if or (eq .Section "events") (eq .Section "recurrent") }} {{ if gt .Site.Taxonomies.events 0 }} {{ end }} {{ end }} {{ end }}