mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
examples: Add example for translation files
This commit is contained in:
parent
04889a5ee6
commit
5b40eeede1
4 changed files with 7 additions and 11 deletions
2
examples/multilingual/data/translations/en.yaml
Normal file
2
examples/multilingual/data/translations/en.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
head_title: Multilingual
|
||||
title: My multilingual site
|
2
examples/multilingual/data/translations/et.yaml
Normal file
2
examples/multilingual/data/translations/et.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
head_title: Mitmekeelne
|
||||
title: Minu mitmekeelne leht
|
|
@ -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>
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue