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

89 lines
3.4 KiB
HTML

{{ $visible := "false" }}
{{ $covid := "false" }}
{{ $when := "false" }}
{{ $price := "false" }}
{{ $contact := "false" }}
{{ $showmeta := "false" }}
{{ if and (ne .context.Params.when "") (ne .context.Params.when nil) }}
{{ $showmeta = "true" }}
{{ $when = true }}
{{ end }}
{{ if and (ne .context.Params.price "") (ne .context.Params.price nil) }}
{{ $showmeta = "true" }}
{{ if eq .context.Params.price "free" }}
{{ $price = true }}
{{ end }}
{{ end }}
{{ if and (ne .context.Params.contact "") (ne .context.Params.contact nil) (eq .type "article") }}
{{ $showmeta = "true" }}
{{ $contact = true }}
{{ end }}
{{ if and (ne .context.Params.covid "") (ne .context.Params.covid nil) (eq .type "article") }}
{{ $showmeta = "true" }}
{{ $covid = true }}
{{ end }}
{{ if and (eq $showmeta "true") (ne .type "contact") }}
<div id="articlemeta" style="font-size: smaller;">
{{ if eq $when true }}
<div>{{ .context.Params.when }}</div>
{{ end }}
{{ if eq $price true }}
{{ if eq .context.Params.price "free" }}
<div>{{ if i18n "freeentry" }}{{ i18n "freeentry" }}{{ else }}{{ "Free Entry" }}{{ end }}</div>
{{ else }}
<div>{{ if i18n "entry" }}{{ i18n "entry" }}{{ else }}{{ "Entry" }}{{ end }}: {{ .context.Params.price }}</div>
{{ end }}
{{ end }}
{{ if eq $contact true }}
<div>{{ if i18n "contact" }}{{ i18n "contact" }}{{ else }}{{ "Contact" }}{{ end }} {{ .context.Params.contact | markdownify }} {{ if i18n "or" }}{{ i18n "or" }}{{ else }}{{ "or" }}{{ end }} {{ site.Params.imprintdata.tel }}</div>
{{ end }}
{{ if eq $covid true }}
<div>Covid: {{ .context.Params.covid }}</div>
{{ end }}
</div>
{{ end }}
{{ $small := "solo" }}
{{ $big := "solo" }}
{{ $img := "" }}
{{ $thumb := "" }}
{{ $placeholder := "/images/no_article_pic.png" }}
{{ if ne .context.Section "misc"}}
{{ $img = resources.Get $placeholder }}
{{- $thumb = $img.Resize "1024x" }}
{{ end }}
{{- if or (.context.Resources.ByType "image") (.Summary) ($img) -}}
{{ $small = "multiple_small" }}
{{ $big = "multiple_big" }}
{{ else }}
{{ $small = "multiple_big"}}
{{ end }}
{{- if and (.context.Resources.ByType "image") (ne .context.Section "misc") -}}
{{- $img = index (.context.Resources.ByType "image") 0 -}}
{{- $thumb = $img.Resize "1024x" }}
{{ if ne .context.Content "" }}
{{- $thumb = $img.Resize "2048x" }}
{{ end }}
{{ end }}
<div id="articleinner">
{{ if ne $img "" }}
<div id="articlepicture" class="{{ $small }} borderrad25">
{{ if and (ne .type "list") (.context.Resources.ByType "image") }}<a href="{{- $img.Permalink -}}">{{ end }}
<img src="{{- $thumb.Permalink -}}" class="borderrad25" />
{{ if ne .type "list" }}</a>{{ end }}
{{ if eq .type "article" }}{{ .TableOfContents }}{{ end }}
</div>
{{ end }}
{{- if or .context.Content .context.Summary -}}
<div id="articletext" class="{{ $big }}">
{{ if eq .type "contact" }}{{ partial "structure/contact" }}{{ end }}
{{ if eq .type "list" }}{{- .context.Summary -}}{{ else }}{{- .context.Content -}}{{ end }}
{{ if and .context.Truncated (eq .type "list") }}
<div id="readmore">{{- if i18n "readmore" -}}{{- i18n "readmore" -}}{{- else -}}{{- "readmore" -}}{{- end -}}..</div>
{{ end }}
</div>
{{- end }}