🐛 Fix: Reassignment of variable names

I'm not sure why this is such a big problem, but hugo doesn't seem to like this. It is also better to just use the intended way to reassign vars always.

Before, *feature* images if using background.html would always get overwritten, now that is fixed.
This commit is contained in:
Served Smart committed 2025-06-27 19:21:59 +02:00
1 parent f82776c86b
commit 80486364cd
4 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{{ $images := .Resources.ByType "image" }}
{{ $backgroundImage := $images.GetMatch "*background*" }}
{{ if not $backgroundImage }}
{{ $backgroundImage := $images.GetMatch "*feature*" }}
{{ $backgroundImage = $images.GetMatch "*feature*" }}
{{ end }}
{{ if not $backgroundImage }}
{{ $backgroundImage = $images.GetMatch "{*cover*,*thumbnail*}" }}