fix(shortcodes): allow parent bundle resource lookup on fig-img
All checks were successful
Deploy workflow / deploy (push) Successful in 32s

This commit is contained in:
Matthieu Bessat 2024-12-22 23:32:45 +01:00
parent eabd8fbe70
commit 421f2fa7b0
4 changed files with 17 additions and 4 deletions

View file

@ -14,7 +14,13 @@
{{ if hasPrefix (.Get "src") "https://" }}
{{ $permalink = .Get "src" }}
{{ else }}
{{ $permalink = ((.Page.Resources.GetMatch (.Get "src")).Fill $options).Permalink }}
{{ $resource := .Page.Resources.GetMatch (.Get "src") }}
{{ if not $resource }}
{{ $resource = .Page.Parent.Resources.GetMatch (.Get "src") }}
{{- end -}}
{{ if $resource }}
{{ $permalink = ($resource.Fill $options).Permalink }}
{{- end -}}
{{- end -}}
<img src="{{ $permalink }}"