Hardcode thumbnail name

This commit is contained in:
Christian Wolf 2024-10-24 13:07:53 +02:00
parent 9e79b08227
commit 210e2a5170
2 changed files with 3 additions and 7 deletions

View File

@ -8,9 +8,8 @@
<a href="{{ .RelPermalink }}" class="subalbum">
<div class="teaser">
{{ $sa := . }}
{{ with .Params.teaserImage }}
{{ $img := $sa.Resources.Get . }}
<img src="{{ ($img.Fit "300x200 webm").RelPermalink }}" alt="{{ $sa.Title }}">
{{ with .Resources.Get "thumbnail.jpg" }}
<img src="{{ (.Fit "300x200 webm").RelPermalink }}" alt="{{ $sa.Title }}">
{{ else }}
{{ warnf "Could not find teaser image for %s" .RelPermalink }}
<img src="{{ (resources.Get "img/no-image.png").RelPermalink }}">

View File

@ -1,9 +1,6 @@
{{- $first := true -}}
{{- $filter := images.AutoOrient -}}
{{- $teaser := "" -}}
{{- with .Params.teaserImage -}}
{{- $teaser = $.Resources.GetMatch . -}}
{{- end -}}
{{- $teaser := .Resources.GetMatch "thumbnail.jpg" -}}
{{- range .Resources.ByType "image" -}}
{{- if not (eq $teaser .) -}}
{{- if not $first }}, {{ end }}