🐛 fix: article shortcode across languages (#2130)

This commit is contained in:
ZhenShuo Leo
2025-05-11 21:18:05 +08:00
parent 1d21656d5e
commit 61fcafc319

View File

@@ -1,9 +1,10 @@
{{ $link := .Get "link" }}
{{ $parent := .Page.RelPermalink }}
<section class="space-y-10 w-full">
{{ $RelPermalink := .Get "link" }}
{{ range ( where .Site.RegularPages "RelPermalink" $RelPermalink | first 1 ) }}
{{ if not (eq .RelPermalink $parent) }}
{{ partial "article-link/simple.html" . }}
{{ end }}
{{end}}
</section>
{{ with first 1 (where .Site.AllPages "RelPermalink" $link) }}
{{ $target := index . 0 }}
{{ if ne $target.RelPermalink $parent }}
<section class="space-y-10 w-full">
{{ partial "article-link/simple.html" $target }}
</section>
{{ end }}
{{ end }}