diff --git a/hugo.toml b/hugo.toml index 53dff77..7a0f0ce 100644 --- a/hugo.toml +++ b/hugo.toml @@ -7,13 +7,13 @@ title = 'Chirpy' path = "github.com/gohugoio/hugo-mod-bootstrap-scss/v5" [[menu.main]] - name = "首页" + name = "Home" url = "/" weight = 10 pre = "fa-solid fa-house" [[menu.main]] - name = "关于" + name = "About" url = "/about/" weight = 20 pre = "fa-solid fa-house" diff --git a/i18n/en.yaml b/i18n/en.yaml new file mode 100644 index 0000000..91423bc --- /dev/null +++ b/i18n/en.yaml @@ -0,0 +1,16 @@ +tabs: + home: "Home" + about: "About" + archive: "Archive" + categories: "Categories" + tags: "Tags" + +layout: + post: "Post" + page: "Page" + category: "Category" + tag: "Tag" + +search: + hint: "Search" + cancel: "Cancel" \ No newline at end of file diff --git a/i18n/zh.yaml b/i18n/zh.yaml new file mode 100644 index 0000000..6a156f7 --- /dev/null +++ b/i18n/zh.yaml @@ -0,0 +1,16 @@ +tabs: + home: "首页" + about: "关于" + archive: "归档" + categories: "分类" + tags: "标签" + +layout: + post: "文章" + page: "页面" + category: "分类" + tag: "标签" + +search: + hint: "搜索" + cancel: "取消" \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3b5a68d..7ac811c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,7 +14,7 @@ {{ partial "sidebar.html" . }}
- + {{ partial "topbar.html" . }}
{{ block "main" . }}{{ end }} diff --git a/layouts/partials/topbar.html b/layouts/partials/topbar.html new file mode 100644 index 0000000..8572396 --- /dev/null +++ b/layouts/partials/topbar.html @@ -0,0 +1,75 @@ + +
+
+ + + + + +
+ {{ if eq .Layout "home" }} + {{- .Site.Title -}} + {{ else if or (eq .Type "tabs") (eq .Kind "page") }} + {{- T (printf "tabs.%s" (path.Base $url)) | default .Title -}} + {{ else }} + {{- T (printf "layout.%s" .Layout) | default (.Layout | title) -}} + {{ end }} +
+ + + + + + + + +
+
\ No newline at end of file