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