small fixes

This commit is contained in:
teldra 2022-06-26 16:19:29 +02:00
parent 3bec9cb8a7
commit 980d591294
2 changed files with 23 additions and 13 deletions

View File

@ -0,0 +1 @@

View File

@ -57,19 +57,28 @@
{{- 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 }}
{{ $ignore := slice (.Page.Resources.GetMatch "banner*") }}
{{ $i := .Page.Resources }}
{{ $files := complement $ignore $i }}
{{ if $files }}
<h3>Addendum</h3>
{{ range $files }}
{{ if not (in $content .) }}
{{ if eq .MediaType.MainType "image" }}
{{ $picname := . }}
<a href="{{- $picname.Permalink -}}" class="no_underline">
<img loading="lazy"
src="{{ .Permalink }}"
alt="{{ . }}"
{{ with .Title}} title="{{ . }}"{{ end }}
width={{ $picname.Width }}
height="{{ $picname.Height }}" /><br>
</a>
{{ else }}
{{ $fname := . }}
<div>🗀 <a href="{{ $fname.Permalink }}" class="underline">{{ $fname }}</a></div>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>