From 74ac7cc4e0104cd4953a0df305815f1260596cca Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 18 Apr 2025 14:35:41 +0800 Subject: feat: related posts after content --- i18n/en.yml | 1 + i18n/zh.yml | 1 + layouts/_default/single.html | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/i18n/en.yml b/i18n/en.yml index 2a53c6d3..5d0ed65e 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -17,3 +17,4 @@ postNav: moreLinks: posts: 'All Posts' cards: 'All Cards' +relatedContent: 'Related Content' diff --git a/i18n/zh.yml b/i18n/zh.yml index f5335290..a827365d 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -18,3 +18,4 @@ cards: 最近在学 moreLinks: posts: '所有文章' cards: '所有卡片' +relatedContent: '相关文章' diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0796701f..f81f9208 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -55,6 +55,14 @@ {{ if in .Site.Params.mainSections .Type }} {{ partial "components/comment.html" . }} + {{ with site.RegularPages.Related . | first 5 }} +

{{ T "relatedContent" }}

+ + {{ end }} {{ end }} -- cgit v1.2.3