From ab24e5646cad8d4e7b6a31ca09f6f614f13dc8c4 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Mon, 11 Sep 2017 21:07:37 +0100 Subject: [PATCH] posts: Show related content * Requires Hugo 0.27+ * Refer to https://gohugo.io/content-management/related/ --- i18n/en.yaml | 5 +++++ layouts/_default/single.html | 12 ++++++++++++ theme.toml | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/i18n/en.yaml b/i18n/en.yaml index c735178e..d0ae7967 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -6,6 +6,11 @@ - id: table_of_contents translation: Table of Contents +# General + +- id: related + translation: Related + # Buttons - id: btn_details diff --git a/layouts/_default/single.html b/layouts/_default/single.html index bc14f19a..1f4c329c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -15,6 +15,18 @@ +{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ with $related }} +
+

{{ i18n "related" }}

+ +
+{{ end }} +
{{ partial "section_pager.html" . }}
diff --git a/theme.toml b/theme.toml index 599e0786..c3e484e7 100644 --- a/theme.toml +++ b/theme.toml @@ -3,7 +3,7 @@ license = "MIT" licenselink = "https://github.com/gcushen/hugo-academic/blob/master/LICENSE.md" description = "Easily create beautifully simple academic or personal sites" homepage = "https://github.com/gcushen/hugo-academic" -min_version = 0.24 +min_version = 0.27 tags = ["academic", "portfolio", "responsive",