forked from Bunteshaus/bunteshaus.de
41 lines
1.1 KiB
HTML
41 lines
1.1 KiB
HTML
{{ define "banner" }}
|
|
{{ $image := "" }}
|
|
{{ if .Resources.GetMatch "banner*" }}
|
|
{{ $image = .Resources.GetMatch "banner*" }}
|
|
{{ end }}
|
|
{{ partial "snippets/banner_new" (dict "context" . "image" $image "title" .Title "section" .Section) }}
|
|
{{ end }}
|
|
|
|
{{ define "content" }}
|
|
<article>
|
|
{{- if .Description -}}
|
|
<p>{{ .Description }}</p>
|
|
{{ end }}
|
|
|
|
{{ $content := .Content }}
|
|
|
|
{{ if or .Content (.Resources.ByType "image")}}
|
|
<div class="article_content">
|
|
{{- if .Content -}}
|
|
{{- $content -}}
|
|
{{ end }}
|
|
{{ if .Resources.ByType "image" }}
|
|
{{ range .Resources.ByType "image" }}
|
|
{{ $picname := . }}
|
|
{{ if not (or (in $content $picname ) (hasPrefix $picname "banner") )}}
|
|
<a href="{{- $picname.Permalink -}}" class="article_image no_underline">
|
|
<img loading="lazy"
|
|
src="{{ .Permalink }}"
|
|
alt="{{ . }}"
|
|
{{ with .Title}} title="{{ . }}"{{ end }}
|
|
width={{ $picname.Width }}
|
|
height="{{ $picname.Height }}" /><br>
|
|
</a>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
</article>
|
|
{{ end }}
|