Skip to content

Commit

Permalink
Attempt 1 to resolve #72
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub Action <[email protected]>
  • Loading branch information
actions-user committed Aug 5, 2024
1 parent 5ee9c82 commit 5d7becd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 2 additions & 3 deletions layouts/partials/human_made.html
Original file line number Diff line number Diff line change
@@ -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 -}}
2 changes: 1 addition & 1 deletion layouts/partials/posts_single_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/related-posts.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/svg.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
{{- else if (eq .name "404-archive") -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-archive"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>
{{- else if (eq .name "human-made") -}}
{{- else if (eq .name "humanMade") -}}
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="63" viewBox="0 0 200 63"><path style="fill:none;stroke-width:7.20523;stroke-linecap:butt;stroke-linejoin:miter;stroke:#fff;stroke-opacity:1;stroke-miterlimit:4" d="M1139.74 161.895h781.237v240.053H1139.74Zm0 0" transform="matrix(.25366 0 0 .25466 -288.192 -40.31)"/><path style="stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1" d="M36.602 44.871H26.273a.904.904 0 0 1-.902-.906v-2.719H22.56a.904.904 0 0 1-.903-.906v-3.781l-3.113-1.555a.913.913 0 0 1-.348-1.316l3.461-5.208v-1.543c0-5.503 4.446-9.964 9.926-9.964 5.484 0 9.93 4.46 9.93 9.965-.223 9.851-3.797 8.328-3.946 12.054l-.062 4.973a.92.92 0 0 1-.266.64.9.9 0 0 1-.636.266m-9.426-1.812H35.7l.098-5.153c-.09-2.355 4.133-2.918 3.91-10.879-.129-4.504-3.637-8.242-8.125-8.242-4.484 0-8.121 3.649-8.121 8.153v1.812a.9.9 0 0 1-.152.504l-3.043 4.582 2.695 1.352c.309.156.5.468.5.812v3.434h2.812c.497 0 .903.406.903.906Zm0 0"/><path style="fill:none;stroke-width:8.24336;stroke-linecap:butt;stroke-linejoin:miter;stroke:#fff;stroke-opacity:1;stroke-miterlimit:4" d="M1338.149 282.243c0 43.24-35.05 78.305-78.292 78.305s-78.306-35.064-78.306-78.305c0-43.24 35.064-78.29 78.306-78.29s78.292 35.05 78.292 78.29Zm0 0" transform="matrix(.25366 0 0 .25466 -288.192 -40.31)"/><path style="stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1" d="M70.246 31.281v-5.933h-5.41v5.933h-2.598v-13.84h2.598v5.512h5.41v-5.512h2.602v13.84Zm10.188.2q-2.56.001-3.926-1.399-1.36-1.394-1.36-3.988V17.44h2.602v8.43q-.001 1.642.695 2.492.704.85 2.063.848 1.39-.001 2.14-.887.746-.89.747-2.554V17.44h2.601v8.508q0 2.632-1.465 4.086-1.451 1.443-4.097 1.445m18.18-.2v-8.956c.007-.192.034-1.009.09-2.446q-.628 2.642-.927 3.683l-2.238 7.72h-1.848l-2.238-7.72-.945-3.683q.105 2.278.105 3.016v8.386H88.31v-13.84h3.476l2.223 7.743.191.746.426 1.855.555-2.219 2.28-8.125h3.462v13.84Zm13.503 0-1.101-3.535h-4.73l-1.102 3.535h-2.602l4.531-13.84h3.067l4.507 13.84Zm-3.472-11.707-.051.215q-.088.352-.215.805-.123.45-1.512 4.972h3.567l-1.227-3.98-.379-1.336Zm15.289 11.707-5.41-10.656q.162 1.553.16 2.496v8.16h-2.309v-13.84h2.969l5.488 10.747a26 26 0 0 1-.156-2.7v-8.047h2.308v13.84Zm20.804 0v-8.956q.008-.29.086-2.446-.626 2.642-.926 3.683l-2.238 7.72h-1.847l-2.239-7.72-.941-3.683q.105 2.278.105 3.016v8.386h-2.308v-13.84h3.48l2.219 7.743.195.746.422 1.855.555-2.219 2.281-8.125h3.465v13.84Zm13.5 0-1.101-3.535h-4.73l-1.102 3.535h-2.602l4.531-13.84h3.067l4.508 13.84Zm-3.472-11.707-.051.215q-.089.352-.211.805-.125.45-1.516 4.972h3.567l-1.223-3.98-.379-1.336Zm18.797 4.684q-.001 2.144-.758 3.742-.75 1.594-2.133 2.438-1.371.843-3.152.843h-5.024v-13.84h4.496q3.135 0 4.852 1.77 1.717 1.759 1.719 5.047m-2.618 0c0-1.485-.343-2.617-1.039-3.399q-1.038-1.179-2.969-1.18h-1.84v9.364h2.2q1.675 0 2.664-1.29c.656-.855.984-2.023.984-3.495m4.586 7.023v-13.84h9.762v2.239h-7.164v3.48h6.625v2.238h-6.625v3.645h7.527v2.238ZM66.637 47.598v-3.23h-3.051v3.23H62.12v-7.54h1.465v3.005h3.05v-3.004h1.466v7.539Zm5.742.105q-1.447-.001-2.215-.758-.764-.76-.766-2.172V40.06h1.465v4.59q.001.895.395 1.359.398.461 1.16.46.785 0 1.207-.48.422-.487.422-1.39v-4.54h1.465v4.633q0 1.436-.825 2.227-.82.785-2.308.785m10.246-.105v-4.88l.05-1.331c-.234.96-.41 1.629-.519 2.004l-1.261 4.207h-1.043L78.59 43.39l-.531-2.004q.058 1.242.058 1.64v4.57h-1.3V40.06h1.96l1.25 4.214.11.407.238 1.011.316-1.207 1.286-4.425h1.949v7.539Zm7.613 0-.62-1.926h-2.669l-.62 1.926h-1.466l2.551-7.54h1.73l2.543 7.54Zm-1.957-6.375-.031.117c-.031.129-.074.273-.117.437q-.07.246-.856 2.707h2.012l-.691-2.168-.215-.726Zm8.617 6.375-3.05-5.805q.091.843.09 1.36v4.445h-1.301v-7.54h1.675l3.094 5.852a13 13 0 0 1-.09-1.469V40.06h1.301v7.539Zm8.895 0v-4.88q.008-.156.05-1.331c-.234.96-.41 1.629-.519 2.004l-1.261 4.207h-1.043l-1.262-4.207-.531-2.004q.058 1.242.058 1.64v4.57h-1.3V40.06h1.96l1.254 4.214.11.407.238 1.011.312-1.207 1.286-4.425h1.953v7.539Zm7.613 0-.62-1.926h-2.669l-.62 1.926h-1.466l2.555-7.54h1.727l2.542 7.54Zm-1.957-6.375-.031.117c-.031.129-.074.273-.117.437a236 236 0 0 1-.856 2.707h2.012l-.691-2.168-.215-.726Zm10.594 2.55q.002 1.167-.426 2.036a3.06 3.06 0 0 1-1.203 1.328q-.775.458-1.777.46h-2.832V40.06h2.535q1.766.002 2.734.964.968.956.969 2.75m-1.477 0c0-.812-.195-1.425-.586-1.851-.39-.43-.945-.64-1.671-.64h-1.04v5.097h1.243q.944 0 1.5-.703.555-.7.554-1.903m2.586 3.825v-7.54h5.504v1.223h-4.039v1.89h3.735v1.224h-3.735v1.984h4.242v1.219Zm12.598 0v-4.88l.047-1.331q-.35 1.44-.52 2.004l-1.261 4.207h-1.043l-1.262-4.207-.531-2.004q.058 1.242.058 1.64v4.57h-1.3V40.06h1.96l1.254 4.214.11.407.238 1.011.313-1.207 1.285-4.425h1.953v7.539Zm7.61 0-.622-1.926h-2.668l-.62 1.926h-1.466l2.555-7.54h1.727l2.543 7.54Zm-1.958-6.375-.03.117q-.048.192-.118.437a236 236 0 0 1-.856 2.707h2.012l-.691-2.168-.211-.726Zm9.164 6.375-1.625-2.864h-1.714v2.864h-1.465v-7.54h3.496q1.248 0 1.93.587.68.573.68 1.664.001.788-.419 1.367a1.94 1.94 0 0 1-1.125.754l1.89 3.168Zm-.171-5.227c0-.723-.434-1.086-1.293-1.086h-1.875v2.227h1.914q.616-.001.933-.301.321-.3.32-.84m7.554 5.227-2.512-3.461-.867.71v2.75h-1.465V40.06h1.465v3.418l3.157-3.418h1.707l-2.989 3.191 3.23 4.348Zm2.516 0v-1.633h1.433v1.633Zm6.086-1.137q1.324 0 1.84-1.434l1.277.52c-.273.73-.68 1.27-1.211 1.629q-.795.527-1.906.527c-1.13 0-1.996-.344-2.613-1.027q-.92-1.032-.918-2.883 0-1.857.886-2.852.89-.991 2.578-.992c.82 0 1.493.176 2.008.535q.775.527 1.086 1.559l-1.289.383a1.58 1.58 0 0 0-.648-.899q-.476-.34-1.125-.34-.996.001-1.512.665-.511.663-.512 1.941 0 1.3.528 1.984.531.685 1.53.684m10.883-2.668q0 1.179-.434 2.07c-.29.598-.7 1.051-1.234 1.371-.54.313-1.164.47-1.88.47q-1.647 0-2.585-1.044c-.625-.7-.934-1.652-.934-2.867q-.002-1.812.934-2.828c.62-.68 1.488-1.016 2.594-1.016q1.664-.002 2.597 1.028.944 1.023.942 2.816m-1.496 0q-.001-1.22-.536-1.91c-.359-.461-.859-.696-1.507-.696q-.98 0-1.52.692-.534.685-.535 1.914 0 1.242.547 1.957c.367.477.867.71 1.5.71q.983.001 1.515-.694.535-.693.536-1.973m8.414 3.805v-4.88l.05-1.331q-.352 1.44-.523 2.004l-1.262 4.207h-1.039l-1.262-4.207-.53-2.004q.057 1.242.058 1.64v4.57h-1.301V40.06h1.96l1.25 4.214.11.407.239 1.011.312-1.207 1.29-4.425h1.948v7.539Zm0 0"/><path style="fill:none;stroke-width:8.75123;stroke-linecap:butt;stroke-linejoin:miter;stroke:#fff;stroke-opacity:1;stroke-miterlimit:4" d="M1366.684 298.533h516.179" transform="matrix(.25366 0 0 .25466 -288.192 -40.31)"/><path style="stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1" d="M32.285 37.59v-6.832c.04 0 .082.008.125.008 3.445-.004 6.012-3.192 5.297-6.575a.84.84 0 0 0-.645-.644c-2.855-.613-5.683 1.164-6.382 4.015-.008-.007-.012-.019-.024-.027A5.4 5.4 0 0 0 25.7 26.06a.84.84 0 0 0-.64.644c-.715 3.383 1.851 6.57 5.296 6.574.082 0 .172-.007.258-.011v4.324Zm1-11.383a3.74 3.74 0 0 1 2.863-1.098c.125 2.243-1.722 4.098-3.957 3.977a3.76 3.76 0 0 1 1.094-2.879m-5.574 4.29a3.76 3.76 0 0 1-1.102-2.876c2.239-.125 4.086 1.73 3.961 3.977a3.74 3.74 0 0 1-2.863-1.102Zm0 0"/></svg>
{{- else -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather feather-link" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
Expand Down
6 changes: 3 additions & 3 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ <h1>{{ .Title }}</h1>
{{- 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>
Expand Down

0 comments on commit 5d7becd

Please sign in to comment.