fix: scope of featureimage in front matter

fixes #2977
This commit is contained in:
ZhenShuo Leo committed 2026-06-13 14:43:50 +08:00
1 parent e9699d8c5d
commit 4a45ab6c96
9 files changed
+13 -9

No files matched your search

@@ -37,6 +37,7 @@
{{ if not $target.Params.hideFeatureImage }}
{{/* frontmatter */}}
{{ with $page }}
{{ $p := . }}
{{ with .Params.featureimage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ if site.Params.hotlinkFeatureImage }}
@@ -45,7 +46,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = $p.Resources.Get . }}
{{ end }}
{{ end }}
@@ -11,6 +11,7 @@
{{ if eq $thumbnailAspectRatio "" }}{{ $thumbnailAspectRatio = "1.5" }}{{ end }}
{{/* frontmatter */}}
{{ with $page }}
{{ $p := . }}
{{ with .Params.featureimage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ if site.Params.hotlinkFeatureImage }}
@@ -19,7 +20,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = $p.Resources.Get . }}
{{ end }}
{{ end }}
+2 -1
View File
@@ -14,6 +14,7 @@
{{ if not .Params.hideFeatureImage }}
{{/* frontmatter */}}
{{ with $page }}
{{ $p := . }}
{{ with .Params.featureimage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ if site.Params.hotlinkFeatureImage }}
@@ -22,7 +23,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = $p.Resources.Get . }}
{{ end }}
{{ end }}
+2 -1
View File
@@ -30,6 +30,7 @@
{{ if not .Params.hideFeatureImage }}
{{/* frontmatter */}}
{{ with $page }}
{{ $p := . }}
{{ with .Params.featureimage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ if site.Params.hotlinkFeatureImage }}
@@ -38,7 +39,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = $p.Resources.Get . }}
{{ end }}
{{ end }}
+1 -1
View File
@@ -11,7 +11,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = page.Resources.Get . }}
{{ end }}
{{ end }}
+1 -1
View File
@@ -11,7 +11,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = page.Resources.Get . }}
{{ end }}
{{ end }}
+1 -1
View File
@@ -11,7 +11,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = page.Resources.Get . }}
{{ end }}
{{ end }}
@@ -45,7 +45,7 @@
{{ $featured = resources.GetRemote . }}
{{ end }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = page.Resources.Get . }}
{{ end }}
{{ end }}
+1 -1
View File
@@ -9,7 +9,7 @@
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }}
{{ else }}
{{ $featured = resources.Get . }}
{{ $featured = page.Resources.Get . }}
{{ end }}
{{ end }}