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

102 lines
4.3 KiB
HTML
Raw Normal View History

2022-04-05 20:58:02 +02:00
{{ define "title" }}
2022-04-09 21:34:04 +02:00
<h1>{{ if (i18n .Title (dict "Count" 0))}}{{ i18n .Title (dict "Count" 0) }}{{ else }}{{ .Title }}{{ end }}</h1>
2022-04-05 20:58:02 +02:00
{{ end }}
2022-04-05 17:50:09 +02:00
2022-06-12 13:50:06 +02:00
{{ define "add_content" }}
2022-04-10 00:53:31 +02:00
{{ $partial_before := "" }}
2022-04-10 11:00:14 +02:00
{{ $partial := "layout/article" }}
2022-04-10 00:53:31 +02:00
{{ $pic := "true" }}
{{ if eq .Params.tool "generator" }}
2022-04-10 11:00:14 +02:00
{{ $partial = "layout/generator" }}
2022-04-10 00:53:31 +02:00
{{ else if eq .Params.tool "nottranslated" }}
2022-04-10 11:00:14 +02:00
{{ $partial = "layout/nottranslated" }}
2022-04-28 14:53:58 +02:00
{{ 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 }}
2022-04-10 00:53:31 +02:00
{{ end }}
2022-04-11 18:16:40 +02:00
<article>
2022-06-07 13:36:28 +02:00
2022-04-10 10:35:48 +02:00
{{ partial $partial (dict "context" . "pic" $pic "content" .Content "partial_before" $partial_before "type" "article") }}
2022-04-11 18:16:40 +02:00
</article>
2022-04-04 01:13:42 +02:00
{{ end }}
2022-05-09 21:37:34 +02:00
{{ define "sidebar" }}
{{ if ne .Type "tools" }}
<aside class="sidebar">
2022-06-12 13:50:06 +02:00
{{ if or .Params.categories .Params.events }}
2022-05-09 21:37:34 +02:00
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
2022-06-12 13:50:06 +02:00
{{ end }}
{{ if .Params.categories }}
2022-05-09 21:37:34 +02:00
{{ range .Params.categories }}
<div class="align_menu"><a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
{{ end }}
{{ if .Params.events }}
{{ 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 }}
2022-06-07 13:36:28 +02:00
{{ $related := .Site.RegularPages.RelatedIndices . "tags" | first 5 }}
{{ if $related }}
<h3 class="align_menu">Related</h3>
{{ range $related }}
<div class="align_menu"><a href="{{ .Permalink }}">{{ .Title }}</a></div>
{{ end }}
{{ end }}
2022-05-09 21:37:34 +02:00
</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>
2022-06-12 13:50:06 +02:00
<div class="foundations">
2022-05-09 21:37:34 +02:00
{{ 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 }}
2022-06-12 13:50:06 +02:00
<div class="foundations_item">
2022-05-09 21:37:34 +02:00
{{ if $url }}<a href="{{ $url | safeHTML }}">{{ end }}<img src="{{- $res_im.Permalink -}}" class="borderrad4px article_footer_item1" /> {{ if $url }}</a>{{ end }}
</div>
2022-06-12 14:32:09 +02:00
{{ else if eq hugo.Environment "development" }}
2022-06-12 13:50:06 +02:00
<div class="foundations_item">
2022-05-09 21:37:34 +02:00
assets/images/foundations/{{- $l -}} .* missing
</div>
{{ end }}
{{ end }}
</div>
{{ end }}
2022-06-12 13:50:06 +02:00
<div class="mod_times">
<div class="mod_times_item">
2022-05-09 21:37:34 +02:00
<b>{{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}</b>
{{ .Date | time.Format ":date_full" }}
</div>
{{ if ne .Date .Lastmod }}
2022-06-12 13:50:06 +02:00
<div class="mod_times_item">
2022-05-09 21:37:34 +02:00
<b>{{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}</b>
{{ .Lastmod | time.Format ":date_full" }}
</div>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}