bunteshaus.de/themes/buha/layouts/partials/contentlayouts/article.html
2022-04-05 20:58:02 +02:00

88 lines
3.5 KiB
HTML

{{ $visible := "false" }}
{{ $covid := "false" }}
{{ $when := "false" }}
{{ $price := "false" }}
{{ $contact := "false" }}
{{ $registeremail := "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.registeremail "") (ne .context.Params.registeremail nil) (eq .type "article") }}
{{ $showmeta = "true" }}
{{ $registeremail = true }}
{{ end }}
{{ if and (ne .context.Params.covid "") (ne .context.Params.covid nil) (eq .type "article") }}
{{ $showmeta = "true" }}
{{ $covid = true }}
{{ end }}
{{ if and (ne .context.Params.contact "") (ne .context.Params.contact nil) (eq .type "article") }}
{{ $showmeta = "true" }}
{{ $contact = true }}
{{ end }}
{{ if eq $showmeta "true" }}
<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 }}{{ "freeentry" }}{{ end }}</div>
{{ else }}
<div>{{ if i18n "entry" }}{{ i18n "entry" }}{{ else }}{{ "entry" }}{{ end }}: {{ .context.Params.price }}</div>
{{ end }}
{{ end }}
{{ if eq $registeremail true }}
<div>{{ if i18n "register" }}{{ i18n "register" }}{{ else }}{{ "register" }}{{ end }} {{ .context.Params.registeremail | markdownify }} {{ if i18n "or" }}{{ i18n "or" }}{{ else }}{{ "or" }}{{ end }} {{ site.Params.imprintdata.tel }}</div>
{{ end }}
{{ if eq $covid true }}
<div>Es gilt die {{ .context.Params.covid }} Regel</div>
{{ end }}
{{ if eq $contact true }}
<div>{{ if i18n "contact" }}{{ i18n "contact" }}{{ else }}{{ "contact" }}{{ end }}: {{ if eq .type "article" }}<a href="mailto://{{ .context.Params.contact }}">{{ end }}{{ .context.Params.contact }}{{ if eq .type "article" }}</a>{{ end }}</div>
{{ end }}
</div>
{{ end }}
{{ $small := "solo" }}
{{ $big := "solo" }}
{{ $placeholder := "/images/placeholder_article.jpg" }}
{{ $img := resources.Get $placeholder }}
{{- $thumb := $img.Resize "1024x" }}
{{- if or (.context.Resources.ByType "image") (.Summary) ($img) -}}
{{ $small = "multiple_small" }}
{{ $big = "multiple_big" }}
{{ else }}
{{ $small = "multiple_big"}}
{{ end }}
{{- if .context.Resources.ByType "image" -}}
{{- $img = index (.context.Resources.ByType "image") 0 -}}
{{- $thumb = $img.Resize "1024x" }}
{{ if ne .context.Content "" }}
{{- $thumb = $img.Resize "2048x" }}
{{ end }}
{{ end }}
<div id="articleinner">
<div id="articlepicture" class="{{ $small }} borderrad25">
{{ if eq .type "article" }}<a href="{{- $img.Permalink -}}">{{ end }}
<img src="{{- $thumb.Permalink -}}" class="borderrad25" />
{{ if eq .type "article" }}</a>{{ end }}
</div>
{{- if or .context.Content .context.Summary -}}
<div id="articletext" class="{{ $big }}">
{{ if eq .type "list" }}{{- .context.Summary -}}{{ else }}{{- .context.Content -}}{{ end }}
{{ if and .context.Truncated (eq .type "list") }}
<div id="readmore">{{- i18n "readmore" -}}..</div>
{{ end }}
</div>
{{- end }}