diff options
author | bogem <[email protected]> | 2016-11-21 16:35:52 +0100 |
---|---|---|
committer | digitalcraftsman <[email protected]> | 2016-11-23 19:47:09 +0100 |
commit | 68ebf61613ca5715969818e60343920b4e751933 (patch) | |
tree | 77763545bb22dbcaaa118218e33d25972046f37e /examples | |
parent | 4c72eb12dca7011a0203e4bfcdb618a9d353cf8c (diff) | |
download | hugo-68ebf61613ca5715969818e60343920b4e751933.tar.gz hugo-68ebf61613ca5715969818e60343920b4e751933.zip |
examples: Update multilingual example
Use new i18n concept
Fixes #2417
Diffstat (limited to 'examples')
25 files changed, 312 insertions, 314 deletions
diff --git a/examples/multilingual/config.toml b/examples/multilingual/config.toml index 231e3329f..2c285f0e0 100644 --- a/examples/multilingual/config.toml +++ b/examples/multilingual/config.toml @@ -1,6 +1,39 @@ baseURL = "http://example.com" +defaultContentLanguage = "en" + [taxonomies] -tag = "tags" group = "groups" -menu = "menu" + +[languages] +[languages.en] +weight = 0 +title = "My multilingual site" +[[languages.en.menu.main]] +url = "/home" +name = "Home" +weight = 0 +[[languages.en.menu.main]] +url = "/news" +name = "News" +weight = 1 +[[languages.en.menu.main]] +url = "/about" +name = "About" +weight = 2 + +[languages.et] +weight = 1 +title = "Minu mitmekeelne leht" +[[languages.et.menu.main]] +url = "/kodu" +name = "Kodu" +weight = 0 +[[languages.et.menu.main]] +url = "/uudised" +name = "Uudised" +weight = 1 +[[languages.et.menu.main]] +url = "/minust" +name = "Minust" +weight = 2 diff --git a/examples/multilingual/content/about.en.md b/examples/multilingual/content/about.en.md index 9a7b497c5..c125eea52 100644 --- a/examples/multilingual/content/about.en.md +++ b/examples/multilingual/content/about.en.md @@ -1,17 +1,12 @@ -+++
-title = "About"
-linktitle = "About"
-url = "/about"
-
-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.
-
-Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem!
-
-## History
-
-Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus.
\ No newline at end of file ++++ +title = "About" +url = "/about" ++++ + +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. + +Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem! + +## History + +Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus. diff --git a/examples/multilingual/content/about.et.md b/examples/multilingual/content/about.et.md index be71772fb..57354e886 100644 --- a/examples/multilingual/content/about.et.md +++ b/examples/multilingual/content/about.et.md @@ -1,17 +1,12 @@ -+++
-title = "Minust"
-linktitle = "Minust"
-url = "/minust"
-
-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.
-
-Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem!
-
-## Ajalugu
-
-Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus.
\ No newline at end of file ++++ +title = "Minust" +url = "/minust" ++++ + +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. + +Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem! + +## Ajalugu + +Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus. diff --git a/examples/multilingual/content/index.en.md b/examples/multilingual/content/index.en.md index e819eacca..04ce0e544 100644 --- a/examples/multilingual/content/index.en.md +++ b/examples/multilingual/content/index.en.md @@ -1,15 +1,10 @@ -+++
-title = "Home"
-linktitle = "Home"
-url = "/home"
-
-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.
-
-Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem!
-
-Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus.
\ No newline at end of file ++++ +title = "Home" +url = "/home" ++++ + +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. + +Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem! + +Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus. diff --git a/examples/multilingual/content/index.et.md b/examples/multilingual/content/index.et.md index 0de2d6a71..eee0da2a2 100644 --- a/examples/multilingual/content/index.et.md +++ b/examples/multilingual/content/index.et.md @@ -1,15 +1,10 @@ -+++
-title = "Kodu"
-linktitle = "Kodu"
-url = "/kodu"
-
-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.
-
-Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem!
-
-Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus.
\ No newline at end of file ++++ +title = "Kodu" +url = "/kodu" ++++ + +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. + +Doloremque, veritatis qui impedit expedita quas distinctio temporibus repellendus dicta debitis iure molestias recusandae cum facere natus esse saepe inventore beatae ipsum soluta voluptas in quaerat nam culpa id autem! + +Sequi eum impedit distinctio facilis repudiandae provident iure illo quia autem optio. Ea, facilis, possimus dolor nobis explicabo recusandae numquam ducimus minus eum totam odio architecto nesciunt accusamus expedita natus. diff --git a/examples/multilingual/content/story/alpha.md b/examples/multilingual/content/story/alpha.en.md index 0cbbb5b31..9cd84f6d1 100644 --- a/examples/multilingual/content/story/alpha.md +++ b/examples/multilingual/content/story/alpha.en.md @@ -1,16 +1,14 @@ -+++
-title = "Alpha"
-
-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.
-
-Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum.
-
-Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae.
-
-Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus.
-
-Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid?
\ No newline at end of file ++++ +title = "Alpha" +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. + +Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum. + +Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae. + +Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus. + +Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid? diff --git a/examples/multilingual/content/story/beta.md b/examples/multilingual/content/story/beta.en.md index b098dc6cf..74cd9be3c 100644 --- a/examples/multilingual/content/story/beta.md +++ b/examples/multilingual/content/story/beta.en.md @@ -1,16 +1,14 @@ -+++
-title = "Beta"
-
-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.
-
-Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum.
-
-Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae.
-
-Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus.
-
-Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid?
\ No newline at end of file ++++ +title = "Beta" +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. + +Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum. + +Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae. + +Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus. + +Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid? diff --git a/examples/multilingual/content/story/index.en.md b/examples/multilingual/content/story/index.en.md new file mode 100644 index 000000000..5eaf8e7c2 --- /dev/null +++ b/examples/multilingual/content/story/index.en.md @@ -0,0 +1,5 @@ ++++ +title = "News" +url = "/news" +listing = true ++++ diff --git a/examples/multilingual/content/story/index.md b/examples/multilingual/content/story/index.md deleted file mode 100644 index 00f92d3ad..000000000 --- a/examples/multilingual/content/story/index.md +++ /dev/null @@ -1,10 +0,0 @@ -+++
-title = "News"
-linktitle = "News"
-url = "/news"
-
-listing = true
-lang = "en"
-menu = ["en"]
-menu_weight = 10
-+++
diff --git a/examples/multilingual/content/uudis/alfa.md b/examples/multilingual/content/uudis/alfa.et.md index 85f62718d..c7ecdd823 100644 --- a/examples/multilingual/content/uudis/alfa.md +++ b/examples/multilingual/content/uudis/alfa.et.md @@ -1,16 +1,15 @@ -+++
-title = "Alfa"
-
-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.
-
-Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum.
-
-Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae.
-
-Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus.
-
-Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid?
\ No newline at end of file ++++ +title = "Alfa" +url = "/uudis/alfa" +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. + +Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum. + +Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae. + +Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus. + +Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid? diff --git a/examples/multilingual/content/uudis/beeta.md b/examples/multilingual/content/uudis/beeta.et.md index a6823586e..b50cb4c4c 100644 --- a/examples/multilingual/content/uudis/beeta.md +++ b/examples/multilingual/content/uudis/beeta.et.md @@ -1,16 +1,15 @@ -+++
-title = "Beeta"
-
-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.
-
-Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum.
-
-Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae.
-
-Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus.
-
-Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid?
\ No newline at end of file ++++ +title = "Beeta" +url = "/uudis/beeta" +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. + +Magni, maxime, eum, veniam nam iusto rem error id tenetur porro sed modi reprehenderit excepturi impedit saepe vero ducimus quae consequuntur cupiditate est aperiam in cumque sapiente. Ullam, ex, dolorum. + +Pariatur, mollitia dignissimos commodi nostrum dicta accusantium nisi doloremque ratione molestias ex similique a porro quibusdam harum incidunt veniam laborum ipsum facere impedit maiores quam ad vero in obcaecati molestiae. + +Nam, nisi minus voluptatum dolorem quia doloremque officia architecto facere laborum ullam doloribus voluptates dolores quaerat necessitatibus hic expedita reiciendis inventore tenetur aliquam ab! Aliquid odit veniam accusantium maxime necessitatibus. + +Eos ipsam iusto optio odit id et nisi corporis hic. Iusto, cum, facere officiis ad modi numquam quam recusandae soluta rem consequuntur esse tenetur tempore vel. Veritatis, labore et aliquid? diff --git a/examples/multilingual/content/uudis/index.et.md b/examples/multilingual/content/uudis/index.et.md new file mode 100644 index 000000000..4363c2f6a --- /dev/null +++ b/examples/multilingual/content/uudis/index.et.md @@ -0,0 +1,5 @@ ++++ +title = "Uudised" +url = "/uudised" +listing = true ++++ diff --git a/examples/multilingual/content/uudis/index.md b/examples/multilingual/content/uudis/index.md deleted file mode 100644 index 48d092a37..000000000 --- a/examples/multilingual/content/uudis/index.md +++ /dev/null @@ -1,10 +0,0 @@ -+++
-title = "Uudised"
-linktitle = "Uudised"
-url = "/uudised"
-
-listing = true
-lang = "et"
-menu = ["et"]
-menu_weight = 10
-+++
diff --git a/examples/multilingual/data/translations/en.yaml b/examples/multilingual/data/translations/en.yaml deleted file mode 100644 index beec1ecd7..000000000 --- a/examples/multilingual/data/translations/en.yaml +++ /dev/null @@ -1,2 +0,0 @@ -head_title: Multilingual -title: My multilingual site diff --git a/examples/multilingual/data/translations/et.yaml b/examples/multilingual/data/translations/et.yaml deleted file mode 100644 index 02bc7cae6..000000000 --- a/examples/multilingual/data/translations/et.yaml +++ /dev/null @@ -1,2 +0,0 @@ -head_title: Mitmekeelne -title: Minu mitmekeelne leht diff --git a/examples/multilingual/i18n/en.yaml b/examples/multilingual/i18n/en.yaml new file mode 100644 index 000000000..55528cfee --- /dev/null +++ b/examples/multilingual/i18n/en.yaml @@ -0,0 +1,3 @@ +- id: head_title + translation: "Multilingual" + diff --git a/examples/multilingual/i18n/et.yaml b/examples/multilingual/i18n/et.yaml new file mode 100644 index 000000000..3402619cd --- /dev/null +++ b/examples/multilingual/i18n/et.yaml @@ -0,0 +1,2 @@ +- id: head_title + translation: "Mitmekeelne" diff --git a/examples/multilingual/layouts/_default/single.html b/examples/multilingual/layouts/_default/single.html index 5a83414f8..831cfaf94 100644 --- a/examples/multilingual/layouts/_default/single.html +++ b/examples/multilingual/layouts/_default/single.html @@ -1,4 +1,4 @@ -{{ partial "head.html" . }}
-{{ partial "header.html" . }}
-{{ .Content }}
-{{ partial "footer.html" . }}
+{{ partial "head.html" . }} +{{ partial "header.html" . }} +{{ .Content }} +{{ partial "footer.html" . }} diff --git a/examples/multilingual/layouts/index.html b/examples/multilingual/layouts/index.html index a4273218f..a4a1e5072 100644 --- a/examples/multilingual/layouts/index.html +++ b/examples/multilingual/layouts/index.html @@ -1 +1 @@ -<meta http-equiv="refresh" content="0; url=/home" />
\ No newline at end of file +<meta http-equiv="refresh" content="0; url=/home" /> diff --git a/examples/multilingual/layouts/partials/footer.html b/examples/multilingual/layouts/partials/footer.html index 07a0b1c97..a12f744cc 100644 --- a/examples/multilingual/layouts/partials/footer.html +++ b/examples/multilingual/layouts/partials/footer.html @@ -1,3 +1,3 @@ - <footer id="footer"><span class="copy-left">©</span> 2015 Egon Elbre</footer>
-</body>
-</html>
\ No newline at end of file +<footer id="footer"><span class="copy-left">©</span> 2015 Egon Elbre</footer> +</body> +</html> diff --git a/examples/multilingual/layouts/partials/head.html b/examples/multilingual/layouts/partials/head.html index fee14e72c..e493add1e 100644 --- a/examples/multilingual/layouts/partials/head.html +++ b/examples/multilingual/layouts/partials/head.html @@ -1,11 +1,11 @@ -<!DOCTYPE html>
-<html lang="{{ .Params.lang }}">
-<head>
- <meta charset="utf-8">
- {{ if .Title }}
- <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>
+<!DOCTYPE html> +<html lang="{{ .Params.lang }}"> +<head> + <meta charset="utf-8"> + {{ if .Title }} + <title>{{ i18n "head_title" }} - {{ .Title }}</title> + {{ end }} + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="/main.css"> +</head> +<body> diff --git a/examples/multilingual/layouts/partials/header.html b/examples/multilingual/layouts/partials/header.html index f08c3523c..15f67ba72 100644 --- a/examples/multilingual/layouts/partials/header.html +++ b/examples/multilingual/layouts/partials/header.html @@ -1,17 +1,17 @@ -<header>
- <nav id="language-menu">
- <a href="/home">English</a>
- <a href="/kodu">Eesti</a>
- </nav>
-
- <h1 id="title">{{ (index .Site.Data.translations .Params.lang).title }}</h1>
-
- <nav id="main-menu">
- {{ range (index .Site.Taxonomies.menu .Params.lang).Pages }}
- <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
- {{ end }}
- <div class="clear"></div>
- </nav>
-</header>
-
-<h2 id="subtitle">{{ .Title }}</h2>
+<header> + <nav id="language-menu"> + <a href="/home">English</a> + <a href="/kodu">Eesti</a> + </nav> + + <h1 id="title">{{ .Site.Title }}</h1> + + <nav id="main-menu"> + {{ range .Site.Menus.main }} + <a href="{{ .URL }}">{{ .Name }}</a> + {{ end }} + <div class="clear"></div> + </nav> +</header> + +<h2 id="subtitle">{{ .Title }}</h2> diff --git a/examples/multilingual/layouts/story/single.html b/examples/multilingual/layouts/story/single.html index 0e2a19bdc..beb811cc2 100644 --- a/examples/multilingual/layouts/story/single.html +++ b/examples/multilingual/layouts/story/single.html @@ -1,17 +1,17 @@ -{{ partial "head.html" . }}
-{{ partial "header.html" . }}
-
-{{ if .Params.listing }}
- {{ range .Site.Taxonomies.groups.news.Pages }}
- <article class="post">
- <h3><a href='{{ .Permalink }}'>{{ .Title }}</a> </h3>
- <div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words</div>
- {{ .Summary }}
- <a href='{{ .Permalink }}'><nobr>read more →</nobr></a>
- </article>
- {{ end }}
-{{ else }}
- {{ .Content }}
-{{ end }}
-
-{{ partial "footer.html" . }}
+{{ partial "head.html" . }} +{{ partial "header.html" . }} + +{{ if .Params.listing }} + {{ range .Site.Taxonomies.groups.news.Pages }} + <article class="post"> + <h3><a href='{{ .Permalink }}'>{{ .Title }}</a> </h3> + <div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words</div> + {{ .Summary }} + <a href='{{ .Permalink }}'><nobr>read more →</nobr></a> + </article> + {{ end }} +{{ else }} + {{ .Content }} +{{ end }} + +{{ partial "footer.html" . }} diff --git a/examples/multilingual/layouts/uudis/single.html b/examples/multilingual/layouts/uudis/single.html index 1898b3ad6..1af874d2a 100644 --- a/examples/multilingual/layouts/uudis/single.html +++ b/examples/multilingual/layouts/uudis/single.html @@ -1,17 +1,17 @@ -{{ partial "head.html" . }}
-{{ partial "header.html" . }}
-
-{{ if .Params.listing }}
- {{ range .Site.Taxonomies.groups.uudised.Pages }}
- <article class="post">
- <h3><a href='{{ .Permalink }}'>{{ .Title }}</a> </h3>
- <div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} sõna</div>
- {{ .Summary }}
- <a href='{{ .Permalink }}'><nobr>loe edasi →</nobr></a>
- </article>
- {{ end }}
-{{ else }}
- {{ .Content }}
-{{ end }}
-
-{{ partial "footer.html" . }}
+{{ partial "head.html" . }} +{{ partial "header.html" . }} + +{{ if .Params.listing }} + {{ range .Site.Taxonomies.groups.uudised.Pages }} + <article class="post"> + <h3><a href='{{ .Permalink }}'>{{ .Title }}</a> </h3> + <div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} sõna</div> + {{ .Summary }} + <a href='{{ .Permalink }}'><nobr>loe edasi →</nobr></a> + </article> + {{ end }} +{{ else }} + {{ .Content }} +{{ end }} + +{{ partial "footer.html" . }} diff --git a/examples/multilingual/static/main.css b/examples/multilingual/static/main.css index 13683c448..1a1575ca9 100644 --- a/examples/multilingual/static/main.css +++ b/examples/multilingual/static/main.css @@ -1,90 +1,90 @@ -* { box-sizing: border-box; }
-html, body { margin: 0; padding: 0; }
-
-body {
- padding: 0 20px;
- max-width: 800px;
- margin: 0 auto;
-
- color: #333;
-}
-
-.clear { clear: both; }
-
-
-#language-menu, #main-menu, #title, #subtitle {
- font-family: Georgia;
- font-variant: small-caps;
-}
-
-.copy-left {
- display: inline-block;
- text-align: right;
- margin: 0px;
- -moz-transform: scaleX(-1);
- -o-transform: scaleX(-1);
- -webkit-transform: scaleX(-1);
- transform: scaleX(-1);
- filter: FlipH;
- -ms-filter: "FlipH";
-}
-
-/* Language Menu */
-
-#language-menu { float: right; }
-#language-menu a {
- display: block;
- padding: 8px 10px;
- width: 100px;
-
- transition: border-left 0.3s ease-in-out;
- border-left: 2px solid #FFF;
-}
-#language-menu a:hover { border-left: 2px solid #A00; }
-#language-menu a, #language-menu a:visited {
- color: #333;
-}
-
-/* Main Menu */
-
-#main-menu {
- margin-top: 20px;
- border-left: 2px solid #A00;
- padding-left: 10px;
-}
-
-#main-menu a {
- float: left;
- width: 100px;
- text-align: center;
-
- padding: 5px 10px;
- margin: 0;
-
- text-decoration: none;
- font-size: 18px;
-
- transition: border-bottom 0.3s ease-in-out;
- border-bottom: 2px solid #FFF;
-}
-
-#main-menu a:hover {
- border-bottom: 2px solid #A00;
-}
-
-/* Content */
-
-article h3 {
- margin-bottom: 3px;
-}
-.post-meta {
- color: #888;
- margin-bottom: 10px;
-}
-
-/* Footer */
-
-#footer {
- margin: 50px 0;
- text-align: center;
-}
\ No newline at end of file +* { box-sizing: border-box; } +html, body { margin: 0; padding: 0; } + +body { + padding: 0 20px; + max-width: 800px; + margin: 0 auto; + + color: #333; +} + +.clear { clear: both; } + + +#language-menu, #main-menu, #title, #subtitle { + font-family: Georgia; + font-variant: small-caps; +} + +.copy-left { + display: inline-block; + text-align: right; + margin: 0px; + -moz-transform: scaleX(-1); + -o-transform: scaleX(-1); + -webkit-transform: scaleX(-1); + transform: scaleX(-1); + filter: FlipH; + -ms-filter: "FlipH"; +} + +/* Language Menu */ + +#language-menu { float: right; } +#language-menu a { + display: block; + padding: 8px 10px; + width: 100px; + + transition: border-left 0.3s ease-in-out; + border-left: 2px solid #FFF; +} +#language-menu a:hover { border-left: 2px solid #A00; } +#language-menu a, #language-menu a:visited { + color: #333; +} + +/* Main Menu */ + +#main-menu { + margin-top: 20px; + border-left: 2px solid #A00; + padding-left: 10px; +} + +#main-menu a { + float: left; + width: 100px; + text-align: center; + + padding: 5px 10px; + margin: 0; + + text-decoration: none; + font-size: 18px; + + transition: border-bottom 0.3s ease-in-out; + border-bottom: 2px solid #FFF; +} + +#main-menu a:hover { + border-bottom: 2px solid #A00; +} + +/* Content */ + +article h3 { + margin-bottom: 3px; +} +.post-meta { + color: #888; + margin-bottom: 10px; +} + +/* Footer */ + +#footer { + margin: 50px 0; + text-align: center; +} |