Fix #1: add i18n for en/ru

This commit is contained in:
Dmitry Kolosov 2020-01-26 19:09:07 +03:00
parent 0f60a781eb
commit 63e411c12f
9 changed files with 73 additions and 13 deletions

View file

@ -1,6 +1,6 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<h1>{{ i18n .Title }}</h1>
{{ range (.Site.RegularPages.GroupByPublishDate "2006") }}
{{ range .Pages }}
<div class="post-short-list">

View file

@ -1,6 +1,6 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<h1>{{ i18n .Title }}</h1>
<ul class="terms">
{{ range $key, $value := .Data.Terms }}

View file

@ -22,7 +22,7 @@
</div>
{{ .Summary }}
<div class="read-more">
<a href="{{ .RelPermalink }}">Читать дальше</a>
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
</article>

View file

@ -1,3 +1,3 @@
<p>© Дмитрий Колосов, 2020<br>
Движок <a target="_blank" href="https://gohugo.io/">Hugo</a>, тема <a target="_blank" href="https://github.com/mitrichius/hugo-theme-anubis">Anubis</a>.
<p>© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}2020<br>
{{ i18n "powered" | humanize }} <a target="_blank" href="https://gohugo.io/">Hugo</a>, {{ i18n "theme" }} <a target="_blank" href="https://github.com/mitrichius/hugo-theme-anubis">Anubis</a>.
</p>

View file

@ -1,21 +1,23 @@
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
{{ $toNewPostsMessage := i18n "toNewPosts" | humanize }}
{{ $toOldPostsMessage := i18n "toOldPosts" | humanize }}
<div class="pagination">
<div class="left">
{{ if .Paginator.HasPrev }}
{{ if eq .Paginator.PageNumber 2 }}
<a class="pagination-item" href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">К новым постам</a>
<a class="pagination-item" href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
{{ else }}
<a class="pagination-item" href="{{ .Paginator.Prev.URL }}">К новым постам</a>
<a class="pagination-item" href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
{{ end }}
{{ else }}
<span class="pagination-item disabled">К новым постам</span>
<span class="pagination-item disabled">{{ $toNewPostsMessage }}</span>
{{ end }}
</div>
<div class="right">
{{ if .Paginator.HasNext }}
<a class="pagination-item" href="{{ .Paginator.Next.URL }}">К старым постам</a>
<a class="pagination-item" href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
{{ else }}
<span class="pagination-item disabled">К старым постам</span>
<span class="pagination-item disabled">{{ $toOldPostsMessage }}</span>
{{ end }}
</div>
</div>

View file

@ -1,6 +1,6 @@
{{ define "main" }}
<h1>Tag: {{ .Title }}</h1>
<h1>{{ i18n "tag" | humanize }}: {{ .Title }}</h1>
<div class="article-info">
<a href="/tags/">Ко списку всех тегов</a>
</div>
@ -19,7 +19,7 @@
</div>
{{ .Summary }}
<div class="read-more">
<a href="{{ .RelPermalink }}">Читать дальше</a>
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
</article>