Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/puresyntax71/hugo-theme-chunky-poster.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpuresyntax71 <34715246+puresyntax71@users.noreply.github.com>2020-01-07 06:47:11 +0300
committerGitHub <noreply@github.com>2020-01-07 06:47:11 +0300
commiteeb0bd83edf9a2e802f9d287662b13c3e62a9f7d (patch)
tree7f219ea6cd97de7ac62b21c0f12a821f0ae92c2c
parent9cdde6cf9c49399c78cc3d33a3d7be340261db33 (diff)
parent943d0fa782eddc0ac5dc5ef131a2d183da03f340 (diff)
Multilingual hyperlink support (#28)
Multilingual hyperlink support
-rw-r--r--i18n/ja.yaml12
-rw-r--r--layouts/partials/header.html5
-rw-r--r--layouts/partials/i18nlist.html6
3 files changed, 21 insertions, 2 deletions
diff --git a/i18n/ja.yaml b/i18n/ja.yaml
new file mode 100644
index 0000000..6ed6bae
--- /dev/null
+++ b/i18n/ja.yaml
@@ -0,0 +1,12 @@
+# Single
+wordCount:
+ one: "{{ .Count }} letter"
+ other: "{{ .Count }} letters"
+
+readingTime:
+ one: "{{ .Count }} min read"
+ other: "{{ .Count }} mins read"
+
+# Author
+articles:
+ other: "Articles"
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 70dad5d..6cb45d2 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -6,13 +6,14 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="main-menu">
- {{ with .Site.Menus.main }}
<ul class="navbar-nav ml-auto">
+ {{ partial "i18nlist.html" . }}
+ {{ with .Site.Menus.main }}
{{ range . }}
<li class="nav-item{{ if $current.IsMenuCurrent "main" . }} active{{ end }}"><a class="nav-link" href="{{ .URL | relLangURL }}">{{ .Name }}</a></li>
{{ end }}
- </ul>
{{ end }}
+ </ul>
</div>
</div>
</nav>
diff --git a/layouts/partials/i18nlist.html b/layouts/partials/i18nlist.html
new file mode 100644
index 0000000..486e1f3
--- /dev/null
+++ b/layouts/partials/i18nlist.html
@@ -0,0 +1,6 @@
+{{ if .IsTranslated }}
+ {{ range .Translations }}
+ <li class="nav-item"><a class="nav-link" href="{{ .Permalink }}">{{ .Lang }}</a>
+ </li>
+ {{ end}}
+{{ end }}