mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 09:12:47 +00:00
When loading a featured image, support global image resources (#326)
This commit is contained in:
parent
c5aec1c5df
commit
65e4aa5269
@ -20,7 +20,17 @@
|
||||
{{ $matches := "feature,cover" }}
|
||||
{{/* Use the value from front matter if present */}}
|
||||
{{ with .Params.featured_image }}
|
||||
{{/* If we find a remote global Resource matching the exact value, we use it. */}}
|
||||
{{ if (hasPrefix . "http") }}
|
||||
{{ with resources.GetRemote . }}
|
||||
{{ $coverImage = . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{/* If we find a local global Resource matching the exact value, we use it. */}}
|
||||
{{ with resources.Get . }}
|
||||
{{ $coverImage = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{/* If we find a Page Resource matching the exact value, we use it instead. */}}
|
||||
{{ with $.Resources.GetMatch . }}
|
||||
{{ $coverImage = . }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user