Add multilingual support
This commit is contained in:
parent
9d324b29a7
commit
3f5dced32f
@ -8,7 +8,7 @@
|
|||||||
<ul class="terms">
|
<ul class="terms">
|
||||||
{{ range $key, $value := .Data.Terms }}
|
{{ range $key, $value := .Data.Terms }}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ (print $.Data.Plural "/" (lower $key)) | absURL }}">
|
<a href="{{ (print $.Data.Plural "/" (lower $key)) | absLangURL }}">
|
||||||
{{ $key }}
|
{{ $key }}
|
||||||
</a>
|
</a>
|
||||||
({{ len $value }})
|
({{ len $value }})
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
{{ if .Params.categories }}
|
{{ if .Params.categories }}
|
||||||
<ul class="article-categories">
|
<ul class="article-categories">
|
||||||
{{ range .Params.categories }}
|
{{ range .Params.categories }}
|
||||||
<li><a href="{{ "categories/" | absURL }}{{ . }}">{{ . }}</a></li>
|
<li><a href="{{ "categories/" | absLangURL }}{{ . }}">{{ . }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .Params.tags }}
|
{{ if .Params.tags }}
|
||||||
<ul class="article-tags">
|
<ul class="article-tags">
|
||||||
{{ range .Params.tags }}
|
{{ range .Params.tags }}
|
||||||
<li><a href="{{ "tags/" | absURL }}{{ . | urlize}}">#{{ . }}</a></li>
|
<li><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">#{{ . }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<h1 class="site-header">
|
<h1 class="site-header">
|
||||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
<nav>
|
<nav>
|
||||||
{{ $currentPage := . }}
|
{{ $currentPage := . }}
|
||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main }}
|
||||||
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
|
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
{{ if eq .Paginator.PageNumber 2 }}
|
{{ if eq .Paginator.PageNumber 2 }}
|
||||||
<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
|
<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<a href="{{ .Paginator.Prev.URL | absURL }}">{{ $toNewPostsMessage }}</a>
|
<a href="{{ .Paginator.Prev.URL | absLangURL }}">{{ $toNewPostsMessage }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
|
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
|
||||||
{{ if .Paginator.HasNext }}
|
{{ if .Paginator.HasNext }}
|
||||||
<a href="{{ .Paginator.Next.URL | absURL }}">{{ $toOldPostsMessage }}</a>
|
<a href="{{ .Paginator.Next.URL | absLangURL }}">{{ $toOldPostsMessage }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<h1>{{ i18n "category" | humanize }}: {{ .Title }}</h1>
|
<h1>{{ i18n "category" | humanize }}: {{ .Title }}</h1>
|
||||||
<div class="article-info">
|
<div class="article-info">
|
||||||
<a href="{{ "categories/" | absURL }}">{{ i18n "toAllCategories" | humanize }}</a>
|
<a href="{{ "categories/" | absLangURL }}">{{ i18n "toAllCategories" | humanize }}</a>
|
||||||
</div>
|
</div>
|
||||||
{{ range .Data.Pages }}
|
{{ range .Data.Pages }}
|
||||||
<article class="post-list">
|
<article class="post-list">
|
||||||
|
Loading…
Reference in New Issue
Block a user