diff --git a/README.md b/README.md index 44352b0..eb3bf1b 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,14 @@ You can inject any HTML code to every page's document head or right above the cl LaTeX is supported by this theme through Mathjax. Please check [explaining-configs](https://1bl4z3r.github.io/hermit-V2/en/posts/explaining-configs/) to learn more. +### Translations + +This theme is made specifically with translation in mind. Translations of few languages (English, Spanish, French, Italian, German and Chinese Simplified) are provided in [Staging branch](https://github.com/1bl4z3r/hermit-V2/tree/staging/i18n). However, this theme can work without Translation if your content is **English only**. To have translation of your language : + +1. Create translation tables in the i18n directory, naming each file according to RFC 5646. E.g. `i18n/<2-2 Language Code>.toml`. To find your Language code, visit [https://gist.github.com/msikma/8912e62ed866778ff8cd](https://gist.github.com/msikma/8912e62ed866778ff8cd) to get an idea for the code. See [Staging Branch](https://github.com/1bl4z3r/hermit-V2/tree/staging) to see how this is implemented. +2. Copy [English Translation key](https://github.com/1bl4z3r/hermit-V2/blob/staging/i18n/en.toml) and edit to your language. Edit the section `other = ""`. + + ## Acknowledgments * [normalize.css](https://necolas.github.io/normalize.css/) - [MIT](https://github.com/necolas/normalize.css/blob/master/LICENSE.md) diff --git a/layouts/404.html b/layouts/404.html index 4739c64..60c4ad0 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -3,10 +3,10 @@

{{- partial "svg.html" (dict "context" . "name" "404-lighthouse") -}}

diff --git a/layouts/partials/human_made.html b/layouts/partials/human_made.html index 140d7e0..e31b5b7 100644 --- a/layouts/partials/human_made.html +++ b/layouts/partials/human_made.html @@ -1,7 +1,6 @@ {{- if (and (in .Site.Params.human "single") (ne .Type "posts")) -}} -
{{- partial "svg.html" (dict "context" . "name" "human-made") -}}
+
{{- partial "svg.html" (dict "context" . "name" "humanMade") -}}
{{- end -}} {{- if (and (in .Site.Params.human "posts") (eq .Type "posts")) -}} -
{{- partial "svg.html" (dict "context" . "name" "human-made") -}}
- +
{{- partial "svg.html" (dict "context" . "name" "humanMade") -}}
{{- end -}} \ No newline at end of file diff --git a/layouts/partials/posts_single_info.html b/layouts/partials/posts_single_info.html index bd6c811..2b4de2b 100644 --- a/layouts/partials/posts_single_info.html +++ b/layouts/partials/posts_single_info.html @@ -9,7 +9,7 @@ {{- with .Params.categories }}

{{- partial "svg.html" (dict "context" . "name" "posts_single_categories") -}}{{- range . -}}{{.}}{{- end }}

{{- end }} -

{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{ i18n "wordCount" . -}} {{- partial "readTime.html" . -}}

+

{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{- if fileExists "i18n" -}} {{ i18n "wordCount" . -}} {{- else -}} {{ .WordCount }} Words {{- end -}} {{- partial "readTime.html" . -}}

{{- partial "svg.html" (dict "context" . "name" "posts_single_date") }}{{ dateFormat .Site.Params.dateformNumTime .Date.Local -}} {{- if and (not (eq .Page.Params.ShowLastmod nil)) (.Page.Params.ShowLastmod) -}} {{- if and .GitInfo .Site.Params.gitUrl -}} diff --git a/layouts/partials/related-posts.html b/layouts/partials/related-posts.html index d533bfd..1ab1f27 100644 --- a/layouts/partials/related-posts.html +++ b/layouts/partials/related-posts.html @@ -1,7 +1,7 @@ {{- $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }}