🐛 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
2025-06-23 02:26:39 +02:00
parent f82776c86b
commit 80486364cd
4 changed files with 13 additions and 13 deletions

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*}" }}