diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-05 21:00:21 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-05 21:00:21 +0800 |
| commit | b8663cc3f37873ab57bb831e558a044b7b8d5d31 (patch) | |
| tree | a74d662847460f530a01cb9b3503019bbdfc54a9 | |
| parent | 67d45b9942d272e96b8f4304399f428bc77163c5 (diff) | |
feat: add thoughts page
Former-commit-id: 1a8b514d40129a57cb5fefb857591152a5daad09
| -rw-r--r-- | i18n/zh.yml | 2 | ||||
| -rw-r--r-- | layouts/_partials/home/home-nav.html | 34 | ||||
| -rw-r--r-- | layouts/stats.html | 1 |
3 files changed, 21 insertions, 16 deletions
diff --git a/i18n/zh.yml b/i18n/zh.yml index 37b2511d..ff0cb2ad 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -14,7 +14,7 @@ postNav: latest: '最新' categories: '搜寻' featured: '精选' - settings: '设置' + thoughts: '碎言' cards: 最近在学 moreLinks: posts: '所有文章' diff --git a/layouts/_partials/home/home-nav.html b/layouts/_partials/home/home-nav.html index 9afb0b24..9ee63bc0 100644 --- a/layouts/_partials/home/home-nav.html +++ b/layouts/_partials/home/home-nav.html @@ -6,19 +6,25 @@ "link" "" "active" (eq "/" $.Page.RelPermalink) ) }} - {{ if eq .Site.Language.Lang "zh" }} - {{ partial "home/home-nav-item" (dict - "text" (T "postNav.featured") - "link" "featured" - "active" (eq "/featured/" $.Page.RelPermalink) - ) }} - {{ partial "home/home-nav-item" (dict - "text" (T "postNav.categories") - "link" "categories" - "active" (or - (strings.HasPrefix $.Page.RelPermalink "/categories/") - (strings.HasPrefix $.Page.RelPermalink "/tags/")) - ) }} - {{ end }} + + {{ partial "home/home-nav-item" (dict + "text" (T "postNav.thoughts") + "link" "thoughts" + "active" (eq "/thoughts/" $.Page.RelPermalink) + ) }} + + {{ partial "home/home-nav-item" (dict + "text" (T "postNav.featured") + "link" "featured" + "active" (eq "/featured/" $.Page.RelPermalink) + ) }} + + {{ partial "home/home-nav-item" (dict + "text" (T "postNav.categories") + "link" "categories" + "active" (or + (strings.HasPrefix $.Page.RelPermalink "/categories/") + (strings.HasPrefix $.Page.RelPermalink "/tags/")) + ) }} </nav> {{ end }} diff --git a/layouts/stats.html b/layouts/stats.html index cdd66f14..457d9e11 100644 --- a/layouts/stats.html +++ b/layouts/stats.html @@ -1,7 +1,6 @@ {{ define "main" }} <article> {{ partial "header" . }} - {{ partial "home/home-nav" . }} <section> <h2>站点统计</h2> |
