bunteshaus.de/themes/buha/layouts/partials/layout/article.html.old

133 lines
5.6 KiB
HTML
Raw Normal View History

2022-05-09 21:37:34 +02:00
{{ $metas := dict "when" .context.Params.when "price" .context.Params.price "contact_mail" .context.Params.contact_mail "covid" .context.Params.covid "insta" .context.Params.insta }}
{{ if eq .type "list" }}
{{ $metas = dict "when" .context.Params.when "price" .context.Params.price }}
{{ end }}
{{ $type := .type }}
{{ $pic := "solo" }}
{{ $text := "solo" }}
{{ if eq $type "list" }}
{{- if and (.context.Resources.ByType "image") (.context.Content) -}}
{{ $pic = "multiple_small" }}
{{ $text = "multiple_big" }}
{{ else if and (.context.Resources.ByType "image") (not (.context.Content)) }}
{{ $pic = "multiple_medium" }}
{{ end }}
{{ end }}
{{ partial "snippets/article_metadata" $metas }}
<div class="articleinner">
{{ $i := .context.Resources.ByType "image" }}
{{- if .context.Content -}}
{{ if eq $type "list" }}
{{ if .context.Resources.Match "banner*" }}
<div class="articlepicture {{ $pic }}">
{{ range $i }}
{{ if hasPrefix .Name "banner" }}
{{ $img := . }}
{{ $thumb := $img.Resize "500x" }}
<img src="{{ $thumb.Permalink }}" />
{{- end }}
{{- end }}
</div>
{{- end }}
{{ end }}
<div class="articletext {{ $text }}">
{{ if eq .type "list" }}{{- .context.Summary -}}{{ else }}{{- .context.Content -}}{{ end }}
{{ if and .context.Truncated (eq .type "list") }}
<div class="readmore">{{- if i18n "readmore" -}}{{- i18n "readmore" -}}{{- else -}}{{- "readmore" -}}{{- end -}}..</div>
{{ end }}
</div>
{{ else }}
{{ if eq $type "article" }}
<div style="display:flex; flex-direction: column;">
{{ range $i }}
{{ if not (hasPrefix .Name "banner") }}
{{ $img := . }}
{{ $thumb := $img.Resize "500x" }}
<a href="{{ $img.Permalink }}"><img src="{{ $thumb.Permalink }}" /></a>
{{- end }}
{{- end }}
</div>
{{ else }}
{{ range first 1 $i }}
{{ if not (hasPrefix .Name "banner") }}
{{ $img := . }}
{{ $thumb := $img.Resize "500x" }}
<img src="{{ $thumb.Permalink }}" />
{{- end }}
{{- end }}
{{ end }}
{{- end }}
</div>
{{ 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 }}
{{ 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 }}
{{ 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 }}