From 2388e11525ebf1acb7676929a08115bdeb2f3d6c Mon Sep 17 00:00:00 2001 From: Simon Guest Date: Thu, 2 Feb 2023 08:14:27 +1300 Subject: [PATCH] Frontmatter variable now called `related` for any related content Now needs full path to content --- .../partials/article/components/related-content.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/layouts/partials/article/components/related-content.html b/layouts/partials/article/components/related-content.html index 80e9e77..25d9311 100644 --- a/layouts/partials/article/components/related-content.html +++ b/layouts/partials/article/components/related-content.html @@ -1,8 +1,8 @@ -{{ $related_posts := slice -}} -{{ range .Params.related_posts -}} -{{ $related_posts = $related_posts | append ($.Site.GetPage (printf "/post/%s" .)) -}} +{{ $explicitly_related := slice -}} +{{ range .Params.related -}} +{{ $explicitly_related = $explicitly_related | append ($.Site.GetPage . ) -}} {{ end -}} -{{ $related := $related_posts | append (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | uniq | first 5 }} +{{ $related := $explicitly_related | append (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | uniq | first 5 }} {{ with $related }} -{{ end }} \ No newline at end of file +{{ end }}