diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8ab2595..8583e2c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -3,6 +3,17 @@ title = "Vno Hugo" baseURL = "https://vno-hugo.netlify.app/" theme = "vno-hugo" +# supported languages: en-us, zh-cn (lowercase language codes only) +defaultContentLanguage = 'en-us' +# here lists available languages, if you wish to add your own custom translation, please refer to https://gohugo.io/content-management/multilingual +[languages] + [languages.en-us] + languageName = 'English(United States)' + weight = 10 + [languages.zh-cn] + languageName = '简体中文(中国大陆)' + weight = 20 + # Pagination paginate = 10 paginatePath = "page" @@ -61,5 +72,9 @@ host = "your_host" title = "Blog" description = "Visit blog" +[params.copyright] +license = 'CC BY-NC-SA 4.0' +license_link = 'http://creativecommons.org/licenses/by-nc-sa/4.0/' + [permalinks] posts = "/:year/:month/:title/" diff --git a/i18n/en-US.toml b/i18n/en-US.toml new file mode 100644 index 0000000..a87182a --- /dev/null +++ b/i18n/en-US.toml @@ -0,0 +1,14 @@ +[continue] + other = 'Continue' + +[earlier] + other = 'Earlier' + +[recent] + other = 'Recent' + +[license] + other = 'This site is licensed under a {{ .Site.Params.copyright.license }} license.' + +[poweredBy] + other = 'Generated by Hugo at {{ . }}, themed with Vno - Hugo.' \ No newline at end of file diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml new file mode 100644 index 0000000..41852b2 --- /dev/null +++ b/i18n/zh-CN.toml @@ -0,0 +1,14 @@ +[continue] + other = '继续阅读' + +[earlier] + other = '更早的文章' + +[recent] + other = '最近的文章' + +[license] + other = '本站点内容基于 {{ .Site.Params.copyright.license }} 协议发布。' + +[poweredBy] + other = '由 Hugo 于 {{ . }} 生成, 采用 Vno - Hugo 作为主题。' \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 8f31c32..8dd8521 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,12 +3,12 @@
{{ .Summary | truncate 250 }}…
+ {{ T "continue" }}{{ .Summary | truncate 250 }}…
+ {{ T "continue" }}{{ .Prev.Summary | truncate 250}}…
{{ end }} diff --git a/layouts/partials/side-panel.html b/layouts/partials/side-panel.html index 10e92ef..b2addd9 100644 --- a/layouts/partials/side-panel.html +++ b/layouts/partials/side-panel.html @@ -5,8 +5,8 @@