mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +00:00
Changes .GetMatch Pattern to find bundled assets
When I attempted to use `func/GetFeaturedImage.html`, it did not find my resource, `images/foo-cover.webp`. Updating the match syntax to the pattern expressed here, provided expected behavior: Per: https://gohugo.io/content-management/page-resources/#pattern-matching > .Resources.Match "*sunset.jpg" 🚫 and... > .Resources.Match "*" 🚫 Are not expected to work > .Resources.Match "**/sunset.jpg" ✅ which follows this change, does.
This commit is contained in:
parent
8845854aa9
commit
0f40733d46
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
{{/* Find the first image with 'cover' in the name in this page bundle. */}}
|
{{/* Find the first image with 'cover' in the name in this page bundle. */}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $img := (.Resources.ByType "image").GetMatch "*cover*" }}
|
{{ $img := (.Resources.ByType "image").GetMatch "**/*cover*" }}
|
||||||
{{ with $img }}
|
{{ with $img }}
|
||||||
{{ $linkToCover = .Permalink }}
|
{{ $linkToCover = .Permalink }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user