diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 683622a..93b6d81 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,5 +1,6 @@ baseURL = "https://example.com" languageCode = "en-us" +defaultContentLanguage = "en" title = "Hugo Hermit" theme = "hermit" # enableGitInfo = true diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..b3316f3 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,24 @@ +# Translations for English +# https://gohugo.io/content-management/multilingual/#translation-of-strings + +# 404.html +# +[notFound] +other = "Oops, page not found…" + +[home] +other = "Home" + +[archives] +other = "Archives" + +# posts/single.html +# +[wordCount] +other = "{{ .WordCount }} Words" + +[newer] +other = "Newer" + +[older] +other = "Older" diff --git a/i18n/zh-hans.toml b/i18n/zh-hans.toml new file mode 100644 index 0000000..605cd6b --- /dev/null +++ b/i18n/zh-hans.toml @@ -0,0 +1,24 @@ +# Translations for Simplified Chinese - 简体中文 +# https://gohugo.io/content-management/multilingual/#translation-of-strings + +# 404.html +# +[notFound] +other = "糟糕,您要访问的页面不存在……" + +[home] +other = "主页" + +[archives] +other = "归档" + +# posts/single.html +# +[wordCount] +other = "{{ .WordCount }} 字" + +[newer] +other = "新" + +[older] +other = "旧" diff --git a/layouts/404.html b/layouts/404.html index 535fd1a..691ac08 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -5,10 +5,10 @@

diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 107b6d3..e8b37a8 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -4,7 +4,7 @@ {{ define "main" }} {{- with .Params.featuredImg }} -
+
{{- end }}
@@ -25,7 +25,7 @@ {{- end }}

{{- end }} -

{{ .WordCount }} Words

+

{{ i18n "wordCount" . }}

{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}

{{- if .GitInfo }}

{{ .GitInfo.AbbreviatedHash }} @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}

@@ -35,12 +35,12 @@
{{- with .NextInSection }} {{- end }} {{- with .PrevInSection }} {{- end }}