small fixes

This commit is contained in:
teldra 2022-06-15 21:59:25 +02:00
parent 09c6000c1a
commit 60962764ad
1 changed files with 6 additions and 5 deletions

View File

@ -79,19 +79,20 @@
{{- $c = printf "<p>%s</p>" .Summary -}}
{{- end -}}
{{- end -}}
{{- if $when -}}
{{- $c = printf "<p><b>%s</b></p>%s" $when $c -}}
{{- end -}}
{{- $banner := .Resources.GetMatch "banner*" -}}
{{- if $banner -}}
{{- $c = printf "<img loading=\"lazy\" src=\"%s\" width=\"%d\" height=\"%d\" />%s" $banner.Permalink $banner.Width $banner.Height $c -}}
{{- end -}}
{{- if $when -}}
{{- $c = printf "<p><b>%s</b></p>%s" $when $c -}}
{{- end -}}
{{- range .Resources.ByType "image" -}}
{{ $img := . }}
{{- if not (hasPrefix $img.Name "banner") }}
{{- $c = printf "<img loading=\"lazy\" src=\"%s\" width=\"%d\" height=\"%d\" />%s" $img.Permalink $img.Width $img.Height $c -}}
{{- $c = printf "%s<img loading=\"lazy\" src=\"%s\" width=\"%d\" height=\"%d\" />" $c $img.Permalink $img.Width $img.Height -}}
{{- end -}}
{{- end -}}