From ab6318704c4a5f22793fb738662bb2201fa89082 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 16 May 2025 15:21:10 +0800 Subject: feat: add featured post section --- content/featured.md | 4 +++ i18n/en.yml | 1 + i18n/zh.yml | 1 + layouts/_default/featured.html | 44 ++++++++++++++++++++++++++++++++ layouts/partials/components/postnav.html | 3 +++ 5 files changed, 53 insertions(+) create mode 100644 content/featured.md create mode 100644 layouts/_default/featured.html diff --git a/content/featured.md b/content/featured.md new file mode 100644 index 00000000..37964861 --- /dev/null +++ b/content/featured.md @@ -0,0 +1,4 @@ +--- +title: 精选 +layout: featured +--- diff --git a/i18n/en.yml b/i18n/en.yml index 6427bc96..5e6a266e 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -14,6 +14,7 @@ postNav: latest: 'Latest' categories: 'Categories' tags: 'Tags' + featured: 'Featured' moreLinks: posts: 'All Posts' cards: 'All Cards' diff --git a/i18n/zh.yml b/i18n/zh.yml index c5099c93..8e3c7e72 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -14,6 +14,7 @@ postNav: latest: '最新' categories: '专栏' tags: '标签' + featured: '精选' cards: 最近在学 moreLinks: posts: '所有文章' diff --git a/layouts/_default/featured.html b/layouts/_default/featured.html new file mode 100644 index 00000000..f1484bcb --- /dev/null +++ b/layouts/_default/featured.html @@ -0,0 +1,44 @@ +{{ define "main" }} +
+ {{ partial "header.html" . }} + {{ partial "components/postnav.html" . }} + + + +
+{{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/partials/components/postnav.html b/layouts/partials/components/postnav.html index 95f38a72..5a00797c 100644 --- a/layouts/partials/components/postnav.html +++ b/layouts/partials/components/postnav.html @@ -4,6 +4,9 @@ {{ T "postNav.latest" }} {{ if eq .Site.Language.Lang "zh" }} +
  • + {{ T "postNav.featured" }} +
  • {{ T "postNav.categories" }}
  • -- cgit v1.2.3