examples: Add example for translation files

This commit is contained in:
Richard Metzler 2016-06-11 11:56:10 +02:00 committed by digitalcraftsman
parent 04889a5ee6
commit 5b40eeede1
4 changed files with 7 additions and 11 deletions

View file

@ -0,0 +1,2 @@
head_title: Multilingual
title: My multilingual site

View file

@ -0,0 +1,2 @@
head_title: Mitmekeelne
title: Minu mitmekeelne leht

View file

@ -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>
<body>

View file

@ -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 }}