bunteshaus.de/themes/buha/layouts/_default/single.html
2022-05-09 21:37:34 +02:00

93 lines
4.1 KiB
HTML

{{ define "title" }}
<h1>{{ if (i18n .Title (dict "Count" 0))}}{{ i18n .Title (dict "Count" 0) }}{{ else }}{{ .Title }}{{ end }}</h1>
{{ end }}
{{ define "content" }}
{{ $partial_before := "" }}
{{ $partial := "layout/article" }}
{{ $pic := "true" }}
{{ if eq .Params.tool "generator" }}
{{ $partial = "layout/generator" }}
{{ else if eq .Params.tool "nottranslated" }}
{{ $partial = "layout/nottranslated" }}
{{ else if or (eq .Layout "contact") (eq .Layout "imprint") }}
{{ $partial_before = "snippets/contact" }}
{{ $partial = printf "layout/%s" .Layout }}
{{ else if eq .Layout "archive" }}
{{ $partial = printf "layout/%s" .Layout }}
{{ end }}
<article>
{{ partial $partial (dict "context" . "pic" $pic "content" .Content "partial_before" $partial_before "type" "article") }}
</article>
{{ end }}
{{ define "sidebar" }}
{{ if ne .Type "tools" }}
<aside class="sidebar">
{{ if .Params.categories }}
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
{{ range .Params.categories }}
<div class="align_menu"><a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
{{ end }}
{{ if .Params.events }}
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
{{ range .Params.events }}
<div class="align_menu"><a href="{{ "/events/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
{{ end }}
{{ if .Params.tags }}
<h3 class="align_menu"><a href="{{ "/tags/" | relLangURL }}">{{ if i18n "tags" }}{{ i18n "tags" }}{{ else }}{{ "Tags" }}{{ end }}</a></h3>
{{ range .Params.tags }}
<div class="align_menu"><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
{{ end }}
</aside>
{{ end }}
{{ end }}
{{ define "pagefooter" }}
{{ if and (eq .Kind "page") (or (eq .Section "news") (eq .Section "events") (eq .Section "about")) }}
<div class="article_footer">
{{ with .Params.foundations }}
<b>Träger der Veranstaltung:</b>
<div class="article_footer_foundations1">
{{ range . }}
{{ $l := . }}
{{ $url := "" }}
{{ if isset site.Params.foundations $l }}
{{ $url = index site.Params.foundations $l }}
{{ end }}
{{- $res_im := resources.GetMatch (printf "/images/foundations/%s*" $l ) -}}
{{ if $res_im }}
<div class="article_footer_item1">
{{ if $url }}<a href="{{ $url | safeHTML }}">{{ end }}<img src="{{- $res_im.Permalink -}}" class="borderrad4px article_footer_item1" /> {{ if $url }}</a>{{ end }}
</div>
{{ else }}
<div class="article_footer_item1">
assets/images/foundations/{{- $l -}} .* missing
</div>
{{ end }}
{{ end }}
</div>
{{ end }}
<div class="article_footer_foundations2">
<div class="article_footer_item2">
<b>{{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}</b>
{{ .Date | time.Format ":date_full" }}
</div>
{{ if ne .Date .Lastmod }}
<div class="article_footer_item2">
<b>{{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}</b>
{{ .Lastmod | time.Format ":date_full" }}
</div>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}