fix(article-link): explicitly set featured priority

This commit is contained in:
ZhenShuo Leo
2025-08-31 17:18:46 +08:00
parent 0f7f27b916
commit ff3a6b4253
4 changed files with 16 additions and 8 deletions

View File

@@ -33,9 +33,11 @@
{{ end }}
{{ $images := $target.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ $featured := "" }}
{{ $featuredURL := "" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
{{ end }}
{{ if and $target.Params.featureimage (not $featured) }}
{{ $url:= $target.Params.featureimage }}
{{ $featured = resources.GetRemote $url }}

View File

@@ -4,9 +4,11 @@
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ $featured := "" }}
{{ $featuredURL := "" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
{{ end }}
{{ if and .Params.featureimage (not $featured) }}
{{ $url:= .Params.featureimage }}
{{ $featured = resources.GetRemote $url }}

View File

@@ -6,9 +6,11 @@
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ $featured := "" }}
{{ $featuredURL := "" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
{{ end }}
{{ if and .Params.featureimage (not $featured) }}
{{ $url:= .Params.featureimage }}
{{ $featured = resources.GetRemote $url }}

View File

@@ -33,9 +33,11 @@
{{ end }}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ $featured := "" }}
{{ $featuredURL := "" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
{{ end }}
{{ if and .Params.featureimage (not $featured) }}
{{ $url:= .Params.featureimage }}
{{ $featured = resources.GetRemote $url }}