From f677fbaf4dc9dea0ffb555fc052fdaa506a5ddde Mon Sep 17 00:00:00 2001 From: Mehdi Hasan Date: Tue, 29 Dec 2020 15:02:57 +0100 Subject: [PATCH] show related posts if present --- layouts/partials/related.html | 10 ++++++++++ layouts/posts/single.html | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 layouts/partials/related.html diff --git a/layouts/partials/related.html b/layouts/partials/related.html new file mode 100644 index 00000000..f0258006 --- /dev/null +++ b/layouts/partials/related.html @@ -0,0 +1,10 @@ +{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ with $related }} +
+

See Also

+ +{{ end }} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index d2b60425..48693698 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -65,6 +65,8 @@

+ {{ partial "related.html" . }} + {{ partial "comments.html" . }} {{ partial "page_nav_mobile.html" . }}