From 26030c7fcd5780460fdb87d8f7c3f5975d7fdd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Mon, 13 Jun 2022 21:22:17 +0800 Subject: [PATCH] :lipstick: :bug: Fixed multi languages page display & i18n translate message. --- exampleSite/config.yaml | 25 ++++++++ exampleSite/content/about.en.md | 19 ++++++ exampleSite/content/posts/hello-world.en.md | 58 +++++++++++++++++++ i18n/en.yaml | 4 +- i18n/zh-cn.yaml | 2 +- layouts/partials/header/brand.html | 2 +- layouts/partials/header/menus.html | 2 +- .../partials/post/header_meta/categories.html | 2 +- 8 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 exampleSite/content/about.en.md create mode 100644 exampleSite/content/posts/hello-world.en.md diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index f3c505c..ab72208 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -41,11 +41,36 @@ languages: languageCode: en hasCJKLanguage: false weight: 2 + menus: + main: + - identifier: home + name: Home + url: / + pre: home + weight: 1 + - identifier: about + name: About + url: /about.html + pre: user + weight: 2 + - identifier: archives + name: Archives + url: /posts + pre: archive + weight: 3 + - identifier: commonweal + name: Commonweal 404 + url: /404.html + pre: heartbeat + weight: 4 params: author: Theme NexT subtitle: Theme for Hugo description: Stay easily & powerful. keywords: Hugo,NexT,Theme,easily,powerful + linksSets: + icon: fa fa-globe + title: Friends #-------------------------------------- # Menus Settings diff --git a/exampleSite/content/about.en.md b/exampleSite/content/about.en.md new file mode 100644 index 0000000..a9ae199 --- /dev/null +++ b/exampleSite/content/about.en.md @@ -0,0 +1,19 @@ +--- +title: "About Hugo NexT Origination" +description: "" + +date: 2022-06-09T20:12:52+08:00 +lastmod: 2022-06-09T20:12:52+08:00 + +share: false +followme: false +nav: false +copyright: false +url: about.html +--- + +`Hugo NexT` organization is formed by many friends from all over the world who love the theme and style of `NexT`, so that this theme can continue to be carried forward in the `Hugo` engine. Welcome to join us! + +# Our vision + +Keep the classic black-and-white collocation of `NexT` & keep easily and powerful features. \ No newline at end of file diff --git a/exampleSite/content/posts/hello-world.en.md b/exampleSite/content/posts/hello-world.en.md new file mode 100644 index 0000000..dc49e61 --- /dev/null +++ b/exampleSite/content/posts/hello-world.en.md @@ -0,0 +1,58 @@ +--- +title: "Hello World" +description: "Descript some skill for Hugo build site." + +lastmod: 2022-06-03T16:43:23+08:00 +date: 2022-06-02T11:52:03+08:00 + +categories: + - Blog +tags: + - Hugo + - Startup + +url: hello-world.html +weight: 2 +--- + +> "Use keyword which is `weight` make post sticky to top." + +[Hugo](https://gohugo.io/) is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again. + + + +## Quick Start + +### New Post + +```shell +$ hugo new hello-world.md +``` + +More info: [Front formats](https://gohugo.io/content-management/formats/) + +### Server + +```shell +$ hugo server +``` + +More info: [Hugo Server](https://gohugo.io/commands/hugo_server/) + +### Build + +```shell +$ hugo +``` + +More Info: [Hugo Build](https://gohugo.io/commands/hugo/) + +### Deploy + +```shell +$ hugo deploy +``` + +More Info:[Hugo Deployment](https://gohugo.io/commands/hugo_deploy/) + +Enjoy your Hugo journey & good luck for you! \ No newline at end of file diff --git a/i18n/en.yaml b/i18n/en.yaml index 2261e0d..4fef79f 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -56,7 +56,7 @@ CatesCounterTitle: other: "{{ .Count }} categories in total" ArchiveCounterTitle: zero: No posts. - other: "{{ .Count }} posts in total." + other: "{{ .Count }} posts in total" PostArchiveCheersUm: other: Um.. @@ -84,7 +84,7 @@ PostLastModDate: PostLastModTime: other: "Modify Time" PostCategory: - other: "Classify at" + other: "Classify at" PostWords: other: "Words" PostWordCount: diff --git a/i18n/zh-cn.yaml b/i18n/zh-cn.yaml index e2819c3..eec90dc 100644 --- a/i18n/zh-cn.yaml +++ b/i18n/zh-cn.yaml @@ -85,7 +85,7 @@ PostLastModDate: PostLastModTime: other: 修改时间 PostCategory: - other: "分类于" + other: "分类于" PostWords: other: 字数 PostWordCount: diff --git a/layouts/partials/header/brand.html b/layouts/partials/header/brand.html index 29d36b9..0c1a8ad 100644 --- a/layouts/partials/header/brand.html +++ b/layouts/partials/header/brand.html @@ -13,7 +13,7 @@ {{ $title }} {{- end }} - +

{{ $title }}

diff --git a/layouts/partials/header/menus.html b/layouts/partials/header/menus.html index b286f3e..d4ba243 100644 --- a/layouts/partials/header/menus.html +++ b/layouts/partials/header/menus.html @@ -6,7 +6,7 @@ {{- $active := or ($curP.IsMenuCurrent "main" .) ($curP.HasMenuCurrent "main" .) }} {{- $active = or $active (eq .URL "/")}}