From e3194eca1ef12133fbdcf5157a495097f5087bd9 Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Sun, 31 Aug 2025 16:39:44 +0800 Subject: [PATCH 01/11] 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 (3cc1569fc1269baac374e9de20499aafc34a66fb) Also, Meta tags are not valid inside card elements --- assets/css/compiled/main.css | 5 -- layouts/partials/article-link/_shortcode.html | 52 +++++++--------- .../partials/article-link/card-related.html | 59 ++++++++----------- layouts/partials/article-link/card.html | 53 +++++++---------- layouts/partials/article-link/simple.html | 53 +++++++---------- 5 files changed, 90 insertions(+), 132 deletions(-) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 0eee6a96..ef5ca96d 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -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); diff --git a/layouts/partials/article-link/_shortcode.html b/layouts/partials/article-link/_shortcode.html index 2d11ca81..d22e07d6 100644 --- a/layouts/partials/article-link/_shortcode.html +++ b/layouts/partials/article-link/_shortcode.html @@ -36,38 +36,28 @@ class="absolute inset-0" aria-label="{{ $.Title }}"> - {{- with $target.Params.images -}} - {{- range first 6 . }} - - {{ 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 . }} -
- {{ end }} - {{ else }} - {{ with .Resize "600x" }} - - {{ 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 . }} + {{ end }} - {{- else -}} - {{- with site.Params.images }} - - {{ end -}} - {{- end -}} - {{- end -}} + {{ else }} + {{ with .Resize "600x" }} + + {{ end }} + {{ end }} + {{ end }}