Use localization files in templates.
This commit is contained in:
parent
b0e501f086
commit
bda78fed78
32
themes/vanilla/i18n/en.toml
Normal file
32
themes/vanilla/i18n/en.toml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
[Home]
|
||||||
|
other = "Home"
|
||||||
|
|
||||||
|
[About]
|
||||||
|
other = "About"
|
||||||
|
|
||||||
|
[Resume]
|
||||||
|
other = "Resume"
|
||||||
|
|
||||||
|
[Tags]
|
||||||
|
other = "Tags"
|
||||||
|
|
||||||
|
[AllPosts]
|
||||||
|
other = "All Posts"
|
||||||
|
|
||||||
|
[PostedOn]
|
||||||
|
other = "Posted on {{ .Date.Format \"January 2, 2006\" }}."
|
||||||
|
|
||||||
|
[TableOfContents]
|
||||||
|
other = "Table of Contents"
|
||||||
|
|
||||||
|
[ReadingTime]
|
||||||
|
other = "{{ .WordCount }} words, about {{ .ReadingTime }} minutes to read."
|
||||||
|
|
||||||
|
[Note]
|
||||||
|
other = "note"
|
||||||
|
|
||||||
|
[Tagged]
|
||||||
|
other = "Tagged \"{{ .Title }}\""
|
||||||
|
|
||||||
|
[AllTags]
|
||||||
|
other = "Below is a list of all the tags ever used on this site."
|
|
@ -6,14 +6,14 @@
|
||||||
<a class="button" href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}">{{ . }}</a>
|
<a class="button" href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}">{{ . }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
<p>Posted on {{ .Date.Format "January 2, 2006" }}.</p>
|
<p>{{ i18n "PostedOn" . }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ if not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>") }}
|
{{ if not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>") }}
|
||||||
<div class="table-of-contents">
|
<div class="table-of-contents">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<em>Table of Contents</em>
|
<em>{{ i18n "TableOfContents" }}</em>
|
||||||
{{ .TableOfContents }}
|
{{ .TableOfContents }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
</div>
|
</div>
|
||||||
<nav>
|
<nav>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a href="/">Home</a>
|
<a href="/">{{ i18n "Home" }}</a>
|
||||||
<a href="/about">About</a>
|
<a href="/about">{{ i18n "About" }}</a>
|
||||||
<a href="https://github.com/DanilaFe">GitHub</a>
|
<a href="https://github.com/DanilaFe">GitHub</a>
|
||||||
<a href="/Resume-Danila-Fedorin.pdf">Resume</a>
|
<a href="/Resume-Danila-Fedorin.pdf">{{ i18n "Resume" }}</a>
|
||||||
<a href="/tags">Tags</a>
|
<a href="/tags">{{ i18n "Tags" }}</a>
|
||||||
<a href="/blog">All Posts</a>
|
<a href="/blog">{{ i18n "AllPosts" }}</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .Permalink }}" class="post-title">{{ .Title }}</a>
|
<a href="{{ .Permalink }}" class="post-title">{{ .Title }}</a>
|
||||||
<p class="post-wordcount">{{ .WordCount }} words, about {{ .ReadingTime }} minutes to read.</p>
|
<p class="post-wordcount">{{ i18n "ReadingTime" . }}</p>
|
||||||
<p class="post-preview">{{ .Summary }} . . .</p>
|
<p class="post-preview">{{ .Summary }} . . .</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<label class="sidenote-label" for="numbernote-{{ $id }}">({{ $id }})</label>
|
<label class="sidenote-label" for="numbernote-{{ $id }}">({{ $id }})</label>
|
||||||
<input class="sidenote-checkbox" type="checkbox" id="numbernote-{{ $id }}"></input>
|
<input class="sidenote-checkbox" type="checkbox" id="numbernote-{{ $id }}"></input>
|
||||||
<span class="sidenote-content sidenote-{{ .Get 0 }}">
|
<span class="sidenote-content sidenote-{{ .Get 0 }}">
|
||||||
<span class="sidenote-delimiter">[note:</span>
|
<span class="sidenote-delimiter">[{{ i18n "note" }}:</span>
|
||||||
{{ .Inner }}
|
{{ .Inner }}
|
||||||
<span class="sidenote-delimiter">]</span>
|
<span class="sidenote-delimiter">]</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<label class="sidenote-label" for="{{ .Get 1 }}">{{ .Get 2 }}</label>
|
<label class="sidenote-label" for="{{ .Get 1 }}">{{ .Get 2 }}</label>
|
||||||
<input class="sidenote-checkbox" type="checkbox" id="{{ .Get 1 }}"></input>
|
<input class="sidenote-checkbox" type="checkbox" id="{{ .Get 1 }}"></input>
|
||||||
<span class="sidenote-content sidenote-{{ .Get 0 }}">
|
<span class="sidenote-content sidenote-{{ .Get 0 }}">
|
||||||
<span class="sidenote-delimiter">[note:</span>
|
<span class="sidenote-delimiter">[{{ i18n "Note" }}:</span>
|
||||||
{{ .Inner }}
|
{{ .Inner }}
|
||||||
<span class="sidenote-delimiter">]</span>
|
<span class="sidenote-delimiter">]</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<h2>Tagged "{{ .Title }}"</h2>
|
<h2>{{ i18n "Tagged" . }}</h2>
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range .Pages.ByDate.Reverse }}
|
{{ range .Pages.ByDate.Reverse }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<h2>{{ .Title }}</h2>
|
<h2>{{ .Title }}</h2>
|
||||||
Below is a list of all the tags ever used on this site.
|
{{ i18n "AllTags" }}
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{ range sort .Pages "Title" }}
|
{{ range sort .Pages "Title" }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user