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

106 lines
4.7 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-06-13 04:08:02 +02:00
{{ else if eq .Layout "contact_imprint" }}
2022-04-28 14:53:58 +02:00
{{ $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" }}
2022-06-15 00:05:16 +02:00
<aside class="sidebar">
{{ if or .Params.categories .Params.events }}
<h3 class="align_menu">{{ if i18n "categories" }}{{ i18n "categories" }}{{ else }}{{ "Categories" }}{{ end }}</h3>
2022-05-09 21:37:34 +02:00
{{ end }}
2022-06-15 00:05:16 +02:00
{{ if .Params.categories }}
{{ range .Params.categories }}
<div class="align_menu"><a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
2022-05-09 21:37:34 +02:00
{{ end }}
2022-06-15 00:05:16 +02:00
{{ if .Params.events }}
{{ range .Params.events }}
<div class="align_menu"><a href="{{ "/events/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></div>
{{ end }}
2022-05-09 21:37:34 +02:00
{{ end }}
2022-06-15 00:05:16 +02:00
{{ 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 }}
2022-06-07 13:36:28 +02:00
{{ end }}
2022-06-15 00:05:16 +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 }}
</aside>
2022-05-09 21:37:34 +02:00
{{ 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 }}
2022-06-12 15:12:58 +02:00
<div class="bold">Träger der Veranstaltung:</div>
<div class="foundations_items">
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:33:58 +02:00
{{ else }}
{{ if eq hugo.Environment "development" }}
<div class="foundations_item">
assets/images/foundations/{{- $l -}} .* missing
</div>
{{ else }}
picture missing.
{{ end }}
2022-05-09 21:37:34 +02:00
{{ end }}
{{ end }}
</div>
{{ end }}
2022-06-12 15:12:58 +02:00
<div class="mod_times">
<div class="mod_times_item">
<div class="bold">{{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}: </div>
<div>{{ .Date | time.Format ":date_full" }}</div>
</div>
2022-05-09 21:37:34 +02:00
{{ if ne .Date .Lastmod }}
2022-06-12 13:50:06 +02:00
<div class="mod_times_item">
2022-06-12 15:12:58 +02:00
<div class="bold">{{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}: </div>
<div>{{ .Lastmod | time.Format ":date_full" }}</div>
2022-05-09 21:37:34 +02:00
</div>
{{ end }}
2022-06-12 15:12:58 +02:00
</div>
2022-05-09 21:37:34 +02:00
</div>
{{ end }}
{{ end }}