Fix multilingual site layouts/templates.

This commit is contained in:
Egon Elbre 2015-04-26 18:42:09 +03:00 committed by bep
parent 3596b1b810
commit 9123ac559e
17 changed files with 77 additions and 107 deletions

View file

@ -1,4 +1,4 @@
baseurl = ""
baseurl = "http://example.com"
[taxonomies]
tag = "tags"

View file

@ -1,12 +1,12 @@
---
title: "About"
linktitle: "About"
url: /about
+++
title = "About"
linktitle = "About"
url = "/about"
lang: "en"
menu: ["en"]
menu_weight: 30
---
lang = "en"
menu = ["en"]
menu_weight = 30
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum ex deleniti ut tenetur amet accusantium dolores nam provident! Ipsum, dicta voluptatum quas architecto nostrum sapiente eos commodi numquam accusantium reprehenderit.

View file

@ -1,12 +1,12 @@
---
title: "Minust"
linktitle: "Minust"
url: /minust
+++
title = "Minust"
linktitle = "Minust"
url = "/minust"
lang: "et"
menu: ["et"]
menu_weight: 30
---
lang = "et"
menu = ["et"]
menu_weight = 30
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum ex deleniti ut tenetur amet accusantium dolores nam provident! Ipsum, dicta voluptatum quas architecto nostrum sapiente eos commodi numquam accusantium reprehenderit.

View file

@ -1,12 +1,12 @@
---
title: ""
linktitle: "Home"
url: /
+++
title = "Home"
linktitle = "Home"
url = "/home"
lang: "en"
menu: ["en"]
menu_weight: 0
---
lang = "en"
menu = ["en"]
menu_weight = 0
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum ex deleniti ut tenetur amet accusantium dolores nam provident! Ipsum, dicta voluptatum quas architecto nostrum sapiente eos commodi numquam accusantium reprehenderit.

View file

@ -1,12 +1,12 @@
---
title: ""
linktitle: "Kodu"
url: /kodu
+++
title = "Kodu"
linktitle = "Kodu"
url = "/kodu"
lang: "et"
menu: ["et"]
menu_weight: 0
---
lang = "et"
menu = ["et"]
menu_weight = 0
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum ex deleniti ut tenetur amet accusantium dolores nam provident! Ipsum, dicta voluptatum quas architecto nostrum sapiente eos commodi numquam accusantium reprehenderit.

View file

@ -1,9 +1,9 @@
---
title: "Alpha"
+++
title = "Alpha"
lang: "en"
groups: ["news"]
---
lang = "en"
groups = ["news"]
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione, porro, doloribus ducimus reprehenderit nobis at voluptates ipsa dicta nostrum perferendis in vitae. Magnam, quia officia modi incidunt tenetur ratione cum.

View file

@ -1,9 +1,9 @@
---
title: "Beta"
+++
title = "Beta"
lang: "en"
groups: ["news"]
---
lang = "en"
groups = ["news"]
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione, porro, doloribus ducimus reprehenderit nobis at voluptates ipsa dicta nostrum perferendis in vitae. Magnam, quia officia modi incidunt tenetur ratione cum.

View file

@ -1,10 +1,10 @@
---
title: "News"
linktitle: "News"
url: /news
type: list
+++
title = "News"
linktitle = "News"
url = "/news"
lang: "en"
menu: ["en"]
menu_weight: 10
---
listing = true
lang = "en"
menu = ["en"]
menu_weight = 10
+++

View file

@ -1,9 +1,9 @@
---
title: "Alfa"
+++
title = "Alfa"
lang: "et"
groups: ["uudised"]
---
lang = "et"
groups = ["uudised"]
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione, porro, doloribus ducimus reprehenderit nobis at voluptates ipsa dicta nostrum perferendis in vitae. Magnam, quia officia modi incidunt tenetur ratione cum.

View file

@ -1,9 +1,9 @@
---
title: "Beeta"
+++
title = "Beeta"
lang: "et"
groups: ["uudised"]
---
lang = "et"
groups = ["uudised"]
+++
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione, porro, doloribus ducimus reprehenderit nobis at voluptates ipsa dicta nostrum perferendis in vitae. Magnam, quia officia modi incidunt tenetur ratione cum.

View file

@ -1,10 +1,10 @@
---
title: "Uudised"
linktitle: "Uudised"
url: /uudised
type: list
+++
title = "Uudised"
linktitle = "Uudised"
url = "/uudised"
lang: "et"
menu: ["et"]
menu_weight: 10
---
listing = true
lang = "et"
menu = ["et"]
menu_weight = 10
+++

View file

@ -1,4 +1,4 @@
{{ partial "head.html" . }}
{{ partial "header.html" . }}
{{ if .IsPage }}{{ .Content }}{{ end }}
{{ .Content }}
{{ partial "footer.html" . }}

View file

@ -1,3 +1,3 @@
<footer>(Ↄ) 2013 Egon Elbre</footer>
<footer>(Ↄ) 2015 example.com</footer>
</body>
</html>

View file

@ -1,7 +1,7 @@
<header>
<nav class="menu language-menu">
<ul>
<li><a href="/">English</a></li>
<li><a href="/home">English</a></li>
<li><a href="/kodu">Eesti</a></li>
</ul>
<div class="clear"></div>
@ -15,7 +15,7 @@
<nav class="menu main-menu">
<ul>
{{ range (index .Site.Indexes.menu .Params.lang).Pages }}
{{ range (index .Site.Taxonomies.menu .Params.lang).Pages }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>

View file

@ -1,15 +0,0 @@
{{ partial "head.html" . }}
{{ partial "header.html" . }}
{{ range .Site.Indexes.groups.news.Pages }}
<article class="post">
<header>
<h2><a href='{{ .Permalink }}'>{{ .Title }}</a> </h2>
<div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words</div>
</header>
{{ .Summary }}
<footer>
<a href='{{ .Permalink }}'><nobr>Read more →</nobr></a>
</footer>
</article>
{{ end }}
{{ partial "footer.html" . }}

View file

@ -1,15 +0,0 @@
{{ partial "head.html" . }}
{{ partial "header.html" . }}
{{ range .Site.Indexes.groups.uudised.Pages }}
<article class="post">
<header>
<h2><a href='{{ .Permalink }}'>{{ .Title }}</a> </h2>
<div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} sõna</div>
</header>
{{ .Summary }}
<footer>
<a href='{{ .Permalink }}'><nobr>Loe rohkem →</nobr></a>
</footer>
</article>
{{ end }}
{{ partial "footer.html" . }}

View file

@ -77,7 +77,7 @@ header {
clear: both;
}
footer {
body > footer {
font-family: Georgia;
background: #eee;
margin: 0;