Attempt 1 to resolve #72

Signed-off-by: GitHub Action <action@github.com>
This commit is contained in:
GitHub Action
2024-08-05 14:03:45 +00:00
parent 5ee9c82125
commit 5d7becd0ee
7 changed files with 19 additions and 12 deletions

View File

@ -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 = "<In your Language>"`.
## Acknowledgments
* [normalize.css](https://necolas.github.io/normalize.css/) - [MIT](https://github.com/necolas/normalize.css/blob/master/LICENSE.md)

View File

@ -3,10 +3,10 @@
<p class="img-404">{{- partial "svg.html" (dict "context" . "name" "404-lighthouse") -}}</p>
<div class="banner-404">
<h1>404</h1>
<p>{{ i18n "notFound" }}</p>
<p>{{- if fileExists "i18n" -}} {{ i18n "notFound" }} {{- else -}} Oops, page not found… {{- end -}}</p>
<p class="btn-404">
<a href="{{.Site.BaseURL}}">{{- partial "svg.html" (dict "context" . "name" "404-home") -}}{{ i18n "home" }}</a>
<a href="{{ "posts" | absLangURL }}">{{- partial "svg.html" (dict "context" . "name" "404-archive") -}}{{ i18n "archives" }}</a>
<a href="{{.Site.BaseURL}}">{{- partial "svg.html" (dict "context" . "name" "404-home") -}}{{- if fileExists "i18n" -}} {{ i18n "home" }} {{- else -}} Home {{- end -}}</a>
<a href="{{ "posts" | absLangURL }}">{{- partial "svg.html" (dict "context" . "name" "404-archive") -}}{{- if fileExists "i18n" -}} {{ i18n "archives" }} {{- else -}} Archives {{- end -}}</a>
</p>
</div>
</div>

View File

@ -1,7 +1,6 @@
{{- if (and (in .Site.Params.human "single") (ne .Type "posts")) -}}
<div class="human single"><a href="https://humanmademark.com/" target="_blank" rel="external noreferrer noopener"><abbr title="I don't hate AIs; but I love humans!">{{- partial "svg.html" (dict "context" . "name" "human-made") -}}</abbr></a></div>
<div class="human single"><a href="https://humanmademark.com/" target="_blank" rel="external noreferrer noopener"><abbr title="{{- if fileExists "i18n" -}} {{ i18n "humanMade" }} {{- else -}} I don't hate AIs; but I love humans! {{- end -}}">{{- partial "svg.html" (dict "context" . "name" "humanMade") -}}</abbr></a></div>
{{- end -}}
{{- if (and (in .Site.Params.human "posts") (eq .Type "posts")) -}}
<div class="human posts"><a href="https://humanmademark.com/" target="_blank" rel="external noreferrer noopener"><abbr title="I don't hate AIs; but I love humans!">{{- partial "svg.html" (dict "context" . "name" "human-made") -}}</abbr></a></div>
<div class="human posts"><a href="https://humanmademark.com/" target="_blank" rel="external noreferrer noopener"><abbr title="{{- if fileExists "i18n" -}} {{ i18n "humanMade" }} {{- else -}} I don't hate AIs; but I love humans! {{- end -}}">{{- partial "svg.html" (dict "context" . "name" "humanMade") -}}</abbr></a></div>
{{- end -}}

View File

@ -9,7 +9,7 @@
{{- with .Params.categories }}
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_categories") -}}{{- range . -}}<span class="category"><a href="{{ "categories/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>{{- end }}</p>
{{- end }}
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{ i18n "wordCount" . -}} {{- partial "readTime.html" . -}}</p>
<p>{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{- if fileExists "i18n" -}} {{ i18n "wordCount" . -}} {{- else -}} {{ .WordCount }} Words {{- end -}} {{- partial "readTime.html" . -}}</p>
<p>{{- 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 -}}

View File

@ -1,7 +1,7 @@
{{- $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<div class="related-posts thin">
<h2>{{ i18n "seeAlso" }}</h2>
<h2>{{- if fileExists "i18n" -}} {{ i18n "seeAlso" }} {{- else -}} See Also {{- end -}}</h2>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>

File diff suppressed because one or more lines are too long

View File

@ -51,19 +51,19 @@
{{- end -}}
{{- if .Params.toc }}
<aside id="toc">
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
<div class="toc-title">{{- if fileExists "i18n" -}} {{ i18n "tableOfContents" }} {{- else -}} Table of Contents {{- end -}}</div>
{{ .TableOfContents }}
</aside>
{{- end }}
<div class="post-nav thin">
{{- with .NextInSection }}
<a class="next-post" href="{{ .Permalink }}">
<span class="post-nav-label">{{- partial "svg.html" (dict "context" . "name" "next") -}}&nbsp;{{ i18n "newer" }}</span><br><span>{{ .Title }}</span>
<span class="post-nav-label">{{- partial "svg.html" (dict "context" . "name" "next") -}}&nbsp;{{- if fileExists "i18n" -}} {{ i18n "newer" }} {{- else -}} Newer {{- end -}}</span><br><span>{{ .Title }}</span>
</a>
{{- end }}
{{- with .PrevInSection }}
<a class="prev-post" href="{{ .Permalink }}">
<span class="post-nav-label">{{ i18n "older" }}&nbsp;{{- partial "svg.html" (dict "context" . "name" "previous") -}}</span><br><span>{{ .Title }}</span>
<span class="post-nav-label">{{- if fileExists "i18n" -}} {{ i18n "older" }} {{- else -}} Older {{- end -}}&nbsp;{{- partial "svg.html" (dict "context" . "name" "previous") -}}</span><br><span>{{ .Title }}</span>
</a>
{{- end }}
</div>