From 61fcafc3198dd2f10729e80511efa818cfb5ae1a Mon Sep 17 00:00:00 2001
From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com>
Date: Sun, 11 May 2025 21:18:05 +0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20article=20shortcode=20acr?=
=?UTF-8?q?oss=20languages=20(#2130)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layouts/shortcodes/article.html | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/layouts/shortcodes/article.html b/layouts/shortcodes/article.html
index 68d74e71..393529a4 100644
--- a/layouts/shortcodes/article.html
+++ b/layouts/shortcodes/article.html
@@ -1,9 +1,10 @@
+{{ $link := .Get "link" }}
{{ $parent := .Page.RelPermalink }}
-
- {{ $RelPermalink := .Get "link" }}
- {{ range ( where .Site.RegularPages "RelPermalink" $RelPermalink | first 1 ) }}
- {{ if not (eq .RelPermalink $parent) }}
- {{ partial "article-link/simple.html" . }}
- {{ end }}
- {{end}}
-
\ No newline at end of file
+{{ with first 1 (where .Site.AllPages "RelPermalink" $link) }}
+ {{ $target := index . 0 }}
+ {{ if ne $target.RelPermalink $parent }}
+
+ {{ partial "article-link/simple.html" $target }}
+
+ {{ end }}
+{{ end }}
\ No newline at end of file