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

45 lines
1.6 KiB
HTML
Raw Normal View History

2022-04-28 14:53:58 +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 }}
2022-05-09 21:37:34 +02:00
{{ $banner := slice }}
{{ $image := slice }}
{{ $thumb := "" }}
{{ if .context.Resources.GetMatch "banner*" }}
{{ $banner = slice (.context.Resources.GetMatch "banner*") }}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-05-09 21:37:34 +02:00
{{ if .context.Resources.ByType "image" }}
{{ $image = .context.Resources.ByType "image" }}
{{ end }}
{{ $image = (index (complement $banner $image) 0) }}
{{ if $banner }}
{{ $image = (index $banner 0) }}
{{ end }}
{{ $image = .context.Resources.GetMatch (string $image) }}
{{ if ne $image nil }}
{{ $thumb1 := $image.Fill "1280x480 smart"}}
{{ $thumb = $image}}
2022-04-09 21:34:04 +02:00
{{ end }}
2022-05-06 14:39:53 +02:00
2022-05-09 21:37:34 +02:00
{{ partial "snippets/article_metadata" $metas }}
2022-05-06 14:39:53 +02:00
2022-05-09 21:37:34 +02:00
{{- if .context.Content -}}
2022-06-12 13:50:06 +02:00
<div class="article_content">{{- .context.Content -}}</div>
2022-06-12 23:48:26 +02:00
{{ else if .context.Resources.ByType "image" }}
{{ range .context.Resources.ByType "image" }}
<a href="{{- $image.Permalink -}}" class="no_underline">
<img loading="lazy"
src="{{ .Permalink }}"
alt="{{ . }}"
{{ with .Title}} title="{{ . }}"{{ end }}
width={{ $image.Width }}
height="{{ $image.Height }}" />
<div>{{ . }}</div>
</a>
{{ end }}
2022-04-10 02:24:33 +02:00
{{ end }}
2022-06-12 23:48:26 +02:00
{{ if and (.comtext.Resources.GetMatch $banner) (ne .context.Params.banner false) }}
{{ else if and (.context.Resources.Match "banner*") (ne .context.Params.banner false) }}
{{ else if and (.context.Resources.ByType "image") (ne .context.Params.banner false) }}
{{ else }}
{{ end }}