chore(article-link): remove unused .Params.images

The `.Params.images` and `.Site.Params.images` have existed since the creation of the files
but have never been referenced in the documentation since their initial commit (3cc1569fc1)

Also, Meta tags are not valid inside card elements
This commit is contained in:
ZhenShuo Leo
2025-08-31 16:39:44 +08:00
parent ade5f2c6d6
commit e3194eca1e
5 changed files with 90 additions and 132 deletions

View File

@@ -3239,11 +3239,6 @@ body.zen-mode-enable {
display: inline;
}
}
.ltr\:text-right {
&:where(:dir(ltr), [dir="ltr"], [dir="ltr"] *) {
text-align: right;
}
}
.rtl\:left-0 {
&:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
left: calc(var(--spacing) * 0);

View File

@@ -36,38 +36,28 @@
class="absolute inset-0"
aria-label="{{ $.Title }}"></a>
{{- with $target.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}">
{{ end -}}
{{- else -}}
{{- $images := $target.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if and $target.Params.featureimage (not $featured) }}
{{- $url:= $target.Params.featureimage -}}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{- if not $featured }}
{{ with site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end -}}
{{ if $target.Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
{{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ $images := $target.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ if and $target.Params.featureimage (not $featured) }}
{{ $url:= $target.Params.featureimage }}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{ if not $featured }}
{{ with site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end }}
{{ if $target.Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
{{ with $featured }}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{- else -}}
{{- with site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}">
{{ end -}}
{{- end -}}
{{- end -}}
{{ else }}
{{ with .Resize "600x" }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{ end }}
<div class="{{ $articleInnerClasses }}">

View File

@@ -5,41 +5,32 @@
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
class="absolute inset-0"
aria-label="{{ $.Title }}"></a>
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}">
{{ end -}}
{{- else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if and .Params.featureimage (not $featured) }}
{{- $url:= .Params.featureimage -}}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{- if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end -}}
{{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div
class="thumbnail_card_related nozoom w-full"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div
class="thumbnail_card_related nozoom w-full"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ if and .Params.featureimage (not $featured) }}
{{ $url:= .Params.featureimage }}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{ if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end }}
{{ with $featured }}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div
class="thumbnail_card_related nozoom w-full"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{- else -}}
{{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}">
{{ end -}}
{{- end -}}
{{- end -}}
{{ else }}
{{ with .Resize "600x" }}
<div
class="thumbnail_card_related nozoom w-full"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{ end }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<span class="absolute top-0 right-0 m-2">
{{ partial "badge.html" (i18n "article.draft" | emojify) }}

View File

@@ -5,38 +5,29 @@
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
class="absolute inset-0"
aria-label="{{ $.Title }}"></a>
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}">
{{ end -}}
{{- else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if and .Params.featureimage (not $featured) }}
{{- $url:= .Params.featureimage -}}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{- if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end -}}
{{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
{{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div class="thumbnail_card nozoom w-full" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="thumbnail_card nozoom w-full" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ if and .Params.featureimage (not $featured) }}
{{ $url:= .Params.featureimage }}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{ if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end }}
{{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
{{ with $featured }}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div class="thumbnail_card nozoom w-full" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{- else -}}
{{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}">
{{ end -}}
{{- end -}}
{{- end -}}
{{ else }}
{{ with .Resize "600x" }}
<div class="thumbnail_card nozoom w-full" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{ end }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<span class="absolute top-0 right-0 m-2">
{{ partial "badge.html" (i18n "article.draft" | emojify) }}

View File

@@ -33,38 +33,29 @@
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
class="absolute inset-0"
aria-label="{{ $.Title }}"></a>
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}">
{{ end -}}
{{- else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if and .Params.featureimage (not $featured) }}
{{- $url:= .Params.featureimage -}}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{- if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end -}}
{{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
{{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
{{ if and .Params.featureimage (not $featured) }}
{{ $url:= .Params.featureimage }}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{ if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
{{ end }}
{{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
{{ with $featured }}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{- else -}}
{{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}">
{{ end -}}
{{- end -}}
{{- end -}}
{{ else }}
{{ with .Resize "600x" }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{ end }}
<div class="{{ $articleInnerClasses }}">