summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/multilingual/data/translations/en.yaml2
-rw-r--r--examples/multilingual/data/translations/et.yaml2
-rw-r--r--examples/multilingual/layouts/partials/head.html8
-rw-r--r--examples/multilingual/layouts/partials/header.html6
4 files changed, 7 insertions, 11 deletions
diff --git a/examples/multilingual/data/translations/en.yaml b/examples/multilingual/data/translations/en.yaml
new file mode 100644
index 000000000..beec1ecd7
--- /dev/null
+++ b/examples/multilingual/data/translations/en.yaml
@@ -0,0 +1,2 @@
+head_title: Multilingual
+title: My multilingual site
diff --git a/examples/multilingual/data/translations/et.yaml b/examples/multilingual/data/translations/et.yaml
new file mode 100644
index 000000000..02bc7cae6
--- /dev/null
+++ b/examples/multilingual/data/translations/et.yaml
@@ -0,0 +1,2 @@
+head_title: Mitmekeelne
+title: Minu mitmekeelne leht
diff --git a/examples/multilingual/layouts/partials/head.html b/examples/multilingual/layouts/partials/head.html
index 19f4810e1..fee14e72c 100644
--- a/examples/multilingual/layouts/partials/head.html
+++ b/examples/multilingual/layouts/partials/head.html
@@ -3,13 +3,9 @@
<head>
<meta charset="utf-8">
{{ if .Title }}
- {{ if (eq .Params.lang "et") }}
- <title>Mitmekeelne - {{ .Title }}</title>
- {{ else }}
- <title>Multilingual - {{ .Title }}</title>
- {{ end }}
+ <title>{{ (index .Site.Data.translations .Params.lang).head_title }} - {{ .Title }}</title>
{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/main.css">
</head>
-<body> \ No newline at end of file
+<body>
diff --git a/examples/multilingual/layouts/partials/header.html b/examples/multilingual/layouts/partials/header.html
index e5209f5df..f08c3523c 100644
--- a/examples/multilingual/layouts/partials/header.html
+++ b/examples/multilingual/layouts/partials/header.html
@@ -4,11 +4,7 @@
<a href="/kodu">Eesti</a>
</nav>
- {{ if (eq .Params.lang "et") }}
- <h1 id="title">Minu mitmekeelne leht</h1>
- {{ else }}
- <h1 id="title">My multilingual site</h1>
- {{ end }}
+ <h1 id="title">{{ (index .Site.Data.translations .Params.lang).title }}</h1>
<nav id="main-menu">
{{ range (index .Site.Taxonomies.menu .Params.lang).Pages }}