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 @@
    {{ range .Paginator.Pages }}
  1. -

    {{ .Title }}

    +

    {{ .Title }}

    {{ .Summary | truncate 250 }}…

    {{ with .Params.tags }} {{ range . }} • {{ . }} {{ end }} {{ end }} - 继续阅读
    + {{ T "continue" }}
  2. {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 8f31c32..8dd8521 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,12 +3,12 @@
      {{ range .Paginator.Pages }}
    1. -

      {{ .Title }}

      +

      {{ .Title }}

      {{ .Summary | truncate 250 }}…

      {{ with .Params.tags }} {{ range . }} • {{ . }} {{ end }} {{ end }} - 继续阅读
      + {{ T "continue" }}
    2. {{ end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index ac8f8aa..89d57ad 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -17,7 +17,7 @@ (d.head || d.body).appendChild(s); })(); - + {{ else if .Site.Params.comment.duoshuo }}
      diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 034cfba..ac6c94c 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/layouts/partials/read-more.html b/layouts/partials/read-more.html index 36b67f1..d7aa084 100644 --- a/layouts/partials/read-more.html +++ b/layouts/partials/read-more.html @@ -1,13 +1,13 @@
      {{ if .Next }}
      - 最近的文章 + {{ T "recent" }}

      {{ .Next.Title }}

      {{ .Next.Summary | truncate 250}}…

      {{ with .Next.Params.tags }} {{ range . }} • {{ . }} {{ end }} {{ end }} - 继续阅读 + {{ T "continue" }}
      {{ end }} @@ -15,7 +15,7 @@

      - 更早的文章 + {{ T "earlier" }}

      {{ .Prev.Title }}

      {{ .Prev.Summary | truncate 250}}…

      @@ -25,7 +25,7 @@

      {{ . }} {{ end }} {{ end }} - 继续阅读 + {{ T "continue" }}

      {{ 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 @@
      - -

      {{ .Site.Title }}

      + +

      {{ .Site.Title }}

      {{ if (.Site.Params.subTitle) }} {{ .Site.Params.subTitle }} {{end}} diff --git a/layouts/partials/social.html b/layouts/partials/social.html index 9096f6e..9135037 100644 --- a/layouts/partials/social.html +++ b/layouts/partials/social.html @@ -4,7 +4,7 @@ {{ if .Site.Params.social.weibo }}