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

View File

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