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

90 lines
3.8 KiB
HTML
Raw Normal View History

2022-04-09 21:34:04 +02:00
{{ $metas := dict "when" .context.Params.when "price" .context.Params.price "contact" .context.Params.contact "covid"
.context.Params.covid }}
2022-04-10 10:36:34 +02:00
{{ if eq .type "list" }}
2022-04-09 21:34:04 +02:00
{{ $metas = dict "when" .context.Params.when "price" .context.Params.price }}
{{ end }}
2022-04-11 15:45:49 +02:00
{{ $pic := "solo" }}
{{ $text := "solo" }}
2022-04-09 21:34:04 +02:00
2022-04-11 15:45:49 +02:00
{{- if and (.context.Resources.ByType "image") (.context.Content) -}}
{{ $pic = "multiple_small" }}
{{ $text = "multiple_big" }}
2022-04-11 21:35:30 +02:00
{{ else if and (.context.Resources.ByType "image") (not (.context.Content)) }}
{{ $pic = "multiple_medium" }}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-04-10 10:35:48 +02:00
{{ partial "snippets/article_metadata" $metas }}
2022-04-12 08:26:18 +02:00
<div class="articleinner">
2022-04-10 10:35:48 +02:00
{{- if and (.context.Resources.ByType "image") (eq .pic "true") -}}
2022-04-10 11:00:14 +02:00
{{ $resize := "500x" }}
2022-04-10 10:35:48 +02:00
{{- $img := index (.context.Resources.ByType "image") 0 -}}
{{- $thumb := index (.context.Resources.ByType "image") 0 -}}
2022-04-09 21:34:04 +02:00
{{ if ne .context.Content "" }}
2022-04-11 21:35:30 +02:00
{{- $resize = "2048x" }}
2022-04-10 10:35:48 +02:00
{{ else if eq .type "list" }}
2022-04-11 21:35:30 +02:00
{{- $resize = "500x" }}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-04-10 11:00:14 +02:00
{{- $thumb = $img.Resize $resize }}
2022-04-12 08:26:18 +02:00
<div class="articlepicture {{ $pic }}" >
2022-04-10 10:35:48 +02:00
{{ if and (ne .type "list") (.context.Resources.ByType "image") }}<a href="{{- $img.Permalink -}}">{{ end }}
<img src="{{- $thumb.Permalink -}}" class="borderrad4px" />
2022-04-11 18:16:40 +02:00
{{ if and (ne .type "list") (.context.Resources.ByType "image") }}</a>{{ end }}
2022-04-10 10:35:48 +02:00
</div>
2022-04-09 21:34:04 +02:00
{{ end }}
{{- if or .context.Content .context.Summary -}}
2022-04-12 08:26:18 +02:00
<div class="articletext {{ $text }}">
2022-04-09 21:34:04 +02:00
{{ if eq .type "list" }}{{- .context.Summary -}}{{ else }}{{- .context.Content -}}{{ end }}
{{ if and .context.Truncated (eq .type "list") }}
2022-04-12 08:26:18 +02:00
<div class="readmore">{{- if i18n "readmore" -}}{{- i18n "readmore" -}}{{- else -}}{{- "readmore" -}}{{- end -}}..</div>
2022-04-09 21:34:04 +02:00
{{ end }}
</div>
{{- end }}
</div>
2022-04-10 02:24:33 +02:00
{{ define "pagefooter" }}
{{ if and (eq .Kind "page") (or (eq .Section "news") (eq .Section "events") (eq .Section "about")) }}
2022-04-12 08:26:18 +02:00
<div class="article_footer">
2022-04-10 13:56:50 +02:00
{{ with .Params.foundations }}
<b>Träger der Veranstaltung:</b>
2022-04-12 08:26:18 +02:00
<div class="article_footer_foundations1">
2022-04-10 13:56:50 +02:00
{{ range . }}
{{ $l := . }}
2022-04-10 14:36:57 +02:00
{{ $url := "" }}
{{ if isset site.Params.foundations $l }}
{{ $url = index site.Params.foundations $l }}
{{ end }}
2022-04-10 13:56:50 +02:00
{{- $res_im := resources.GetMatch (printf "/foundations/%s*" $l ) -}}
{{ if $res_im }}
2022-04-11 16:56:06 +02:00
<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 }}
2022-04-10 13:56:50 +02:00
</div>
{{ end }}
{{ end }}
</div>
{{ end }}
2022-04-12 08:26:18 +02:00
<div class="article_footer_foundations2">
2022-04-11 16:56:06 +02:00
<div class="article_footer_item2">
2022-04-11 15:45:49 +02:00
<b>{{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}</b>
2022-04-10 13:56:50 +02:00
{{ .Date | time.Format ":date_full" }}
</div>
{{ if ne .Date .Lastmod }}
2022-04-11 16:56:06 +02:00
<div class="article_footer_item2">
2022-04-11 15:45:49 +02:00
<b>{{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}</b>
2022-04-10 13:56:50 +02:00
{{ .Lastmod | time.Format ":date_full" }}
</div>
{{ end }}
</div>
2022-04-10 02:24:33 +02:00
</div>
{{ end }}
{{ end }}
{{ define "sidebar" }}
{{ if ne .Type "tools" }}
2022-04-10 11:00:14 +02:00
{{- partial "snippets/menu" . }}
2022-04-10 02:24:33 +02:00
{{ end }}
{{ end }}