Support multilingual mode (experimental)

Please report any bugs!
This commit is contained in:
2021-10-11 18:24:14 -05:00
parent 03834fb1ba
commit c7cfb9c844
12 changed files with 88 additions and 14 deletions

View File

@ -4,7 +4,7 @@
<span class="post-meta-item">
{{ partialCached "icon.html" "calendar" "calendar" }}
<time datetime="{{ .Date.Format "January 2, 2006" }}" pubdate>
{{ .Date.Format "January 2, 2006" }}
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time>
</span>
@ -13,7 +13,7 @@
<span class="post-meta-item">
{{ partialCached "icon.html" "edit-2" "edit-2" }}
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
{{ .Lastmod.Format "January 2, 2006" }}
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
</time>
{{ end }}
</span>
@ -23,14 +23,14 @@
{{ if .Site.Params.wordcount }}
<span class="post-meta-item">
{{ partialCached "icon.html" "type" "type" }}
{{ .WordCount }} words
{{ i18n "wordcount" .WordCount }}
</span>
{{ end }}
{{ if .Site.Params.readingtime }}
<span class="post-meta-item">
{{ partialCached "icon.html" "clock" "clock" }}
{{ .ReadingTime }} {{ if gt .ReadingTime 1 }} mins {{ else }} min {{ end }}
{{ i18n "readingtime" .ReadingTime }}
</span>
{{ end }}
@ -38,7 +38,7 @@
{{ with .GitInfo }}
<span class="post-meta-item">
{{ partialCached "icon.html" "git-commit" "git-commit" }}
<a href="{{ (printf "%s/commit/%s" $.Site.Params.repoURL .Hash) | absURL }}">
<a href="{{ (printf "%s/commit/%s" $.Site.Params.repoURL .Hash) | absLangURL }}">
<code>{{ .AbbreviatedHash }}</code>
</a>
</span>