bunteshaus.de/themes/buha/layouts/partials/l1/contact.html
2022-04-11 15:46:02 +02:00

35 lines
1.1 KiB
HTML

{{ $pic := "solo" }}
{{ $text := "solo" }}
{{- if and (.context.Resources.ByType "image") (.content) -}}
{{ $pic = "multiple_small" }}
{{ $text = "multiple_big" }}
{{ end }}
{{ $img := "" }}
{{ $thumb := "" }}
{{- .Resources.ByType "image" -}}
{{- if .context.Resources.ByType "image" -}}
{{- $img = index (.context.Resources.ByType "image") 0 -}}
{{- $thumb = $img.Resize "1024x" }}
{{ if .content }}
{{- $thumb = $img.Resize "500x" }}
{{ end }}
{{ end }}
<section>
<div id="articleinner">
{{ if and (ne $img "") (eq .pic true)}}
<div id="articlepicture" class="{{ $pic }}">
{{ if and (ne .type "list") (.context.Resources.ByType "image") }}<a href="{{- $img.Permalink -}}">{{ end }}
<img src="{{- $thumb.Permalink -}}" class="borderrad4px" />
{{ if ne .type "list" }}</a>{{ end }}
{{ if eq .type "article" }}{{ end }}
</div>
{{ end }}
<div id="articletext" class="{{ $text }}">
{{ if .partial_before }}
{{ partial .partial_before (dict "context" .context "pic" .pic) }}
{{ end }}
{{ .content }}
</div>
</div>
</section>