fix(shortcodes): allow parent bundle resource lookup on fig-img
All checks were successful
Deploy workflow / deploy (push) Successful in 32s
All checks were successful
Deploy workflow / deploy (push) Successful in 32s
This commit is contained in:
parent
eabd8fbe70
commit
421f2fa7b0
4 changed files with 17 additions and 4 deletions
|
|
@ -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 }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue