From 68ebf61613ca5715969818e60343920b4e751933 Mon Sep 17 00:00:00 2001 From: bogem Date: Mon, 21 Nov 2016 16:35:52 +0100 Subject: [PATCH] examples: Update multilingual example Use new i18n concept Fixes #2417 --- examples/multilingual/config.toml | 37 +++- examples/multilingual/content/about.en.md | 29 ++- examples/multilingual/content/about.et.md | 29 ++- examples/multilingual/content/index.en.md | 25 +-- examples/multilingual/content/index.et.md | 25 +-- .../content/story/{alpha.md => alpha.en.md} | 30 ++- .../content/story/{beta.md => beta.en.md} | 30 ++- .../multilingual/content/story/index.en.md | 5 + examples/multilingual/content/story/index.md | 10 - .../content/uudis/{alfa.md => alfa.et.md} | 31 ++- .../content/uudis/{beeta.md => beeta.et.md} | 31 ++- .../multilingual/content/uudis/index.et.md | 5 + examples/multilingual/content/uudis/index.md | 10 - .../multilingual/data/translations/en.yaml | 2 - .../multilingual/data/translations/et.yaml | 2 - examples/multilingual/i18n/en.yaml | 3 + examples/multilingual/i18n/et.yaml | 2 + .../multilingual/layouts/_default/single.html | 8 +- examples/multilingual/layouts/index.html | 2 +- .../multilingual/layouts/partials/footer.html | 6 +- .../multilingual/layouts/partials/head.html | 22 +-- .../multilingual/layouts/partials/header.html | 34 ++-- .../multilingual/layouts/story/single.html | 34 ++-- .../multilingual/layouts/uudis/single.html | 34 ++-- examples/multilingual/static/main.css | 180 +++++++++--------- 25 files changed, 312 insertions(+), 314 deletions(-) rename examples/multilingual/content/story/{alpha.md => alpha.en.md} (92%) rename examples/multilingual/content/story/{beta.md => beta.en.md} (92%) create mode 100644 examples/multilingual/content/story/index.en.md delete mode 100644 examples/multilingual/content/story/index.md rename examples/multilingual/content/uudis/{alfa.md => alfa.et.md} (92%) rename examples/multilingual/content/uudis/{beeta.md => beeta.et.md} (92%) create mode 100644 examples/multilingual/content/uudis/index.et.md delete mode 100644 examples/multilingual/content/uudis/index.md delete mode 100644 examples/multilingual/data/translations/en.yaml delete mode 100644 examples/multilingual/data/translations/et.yaml create mode 100644 examples/multilingual/i18n/en.yaml create mode 100644 examples/multilingual/i18n/et.yaml diff --git a/examples/multilingual/config.toml b/examples/multilingual/config.toml index 231e3329..2c285f0e 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 9a7b497c..c125eea5 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 be71772f..57354e88 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 e819eacc..04ce0e54 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 0de2d6a7..eee0da2a 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 similarity index 92% rename from examples/multilingual/content/story/alpha.md rename to examples/multilingual/content/story/alpha.en.md index 0cbbb5b3..9cd84f6d 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 similarity index 92% rename from examples/multilingual/content/story/beta.md rename to examples/multilingual/content/story/beta.en.md index b098dc6c..74cd9be3 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 00000000..5eaf8e7c --- /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 00f92d3a..00000000 --- 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 similarity index 92% rename from examples/multilingual/content/uudis/alfa.md rename to examples/multilingual/content/uudis/alfa.et.md index 85f62718..c7ecdd82 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 similarity index 92% rename from examples/multilingual/content/uudis/beeta.md rename to examples/multilingual/content/uudis/beeta.et.md index a6823586..b50cb4c4 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 00000000..4363c2f6 --- /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 48d092a3..00000000 --- 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 beec1ecd..00000000 --- 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 02bc7cae..00000000 --- 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 00000000..55528cfe --- /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 00000000..3402619c --- /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 5a83414f..831cfaf9 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 a4273218..a4a1e507 100644 --- a/examples/multilingual/layouts/index.html +++ b/examples/multilingual/layouts/index.html @@ -1 +1 @@ - \ No newline at end of file + diff --git a/examples/multilingual/layouts/partials/footer.html b/examples/multilingual/layouts/partials/footer.html index 07a0b1c9..a12f744c 100644 --- a/examples/multilingual/layouts/partials/footer.html +++ b/examples/multilingual/layouts/partials/footer.html @@ -1,3 +1,3 @@ - - - \ No newline at end of file + + + diff --git a/examples/multilingual/layouts/partials/head.html b/examples/multilingual/layouts/partials/head.html index fee14e72..e493add1 100644 --- a/examples/multilingual/layouts/partials/head.html +++ b/examples/multilingual/layouts/partials/head.html @@ -1,11 +1,11 @@ - - - - - {{ if .Title }} - {{ (index .Site.Data.translations .Params.lang).head_title }} - {{ .Title }} - {{ end }} - - - - + + + + + {{ if .Title }} + {{ i18n "head_title" }} - {{ .Title }} + {{ end }} + + + + diff --git a/examples/multilingual/layouts/partials/header.html b/examples/multilingual/layouts/partials/header.html index f08c3523..15f67ba7 100644 --- a/examples/multilingual/layouts/partials/header.html +++ b/examples/multilingual/layouts/partials/header.html @@ -1,17 +1,17 @@ -
- - -

{{ (index .Site.Data.translations .Params.lang).title }}

- - -
- -

{{ .Title }}

+
+ + +

{{ .Site.Title }}

+ + +
+ +

{{ .Title }}

diff --git a/examples/multilingual/layouts/story/single.html b/examples/multilingual/layouts/story/single.html index 0e2a19bd..beb811cc 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 }} -
-

{{ .Title }}

- - {{ .Summary }} - read more → -
- {{ end }} -{{ else }} - {{ .Content }} -{{ end }} - -{{ partial "footer.html" . }} +{{ partial "head.html" . }} +{{ partial "header.html" . }} + +{{ if .Params.listing }} + {{ range .Site.Taxonomies.groups.news.Pages }} +
+

{{ .Title }}

+ + {{ .Summary }} + read more → +
+ {{ end }} +{{ else }} + {{ .Content }} +{{ end }} + +{{ partial "footer.html" . }} diff --git a/examples/multilingual/layouts/uudis/single.html b/examples/multilingual/layouts/uudis/single.html index 1898b3ad..1af874d2 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 }} -
-

{{ .Title }}

- - {{ .Summary }} - loe edasi → -
- {{ end }} -{{ else }} - {{ .Content }} -{{ end }} - -{{ partial "footer.html" . }} +{{ partial "head.html" . }} +{{ partial "header.html" . }} + +{{ if .Params.listing }} + {{ range .Site.Taxonomies.groups.uudised.Pages }} +
+

{{ .Title }}

+ + {{ .Summary }} + loe edasi → +
+ {{ end }} +{{ else }} + {{ .Content }} +{{ end }} + +{{ partial "footer.html" . }} diff --git a/examples/multilingual/static/main.css b/examples/multilingual/static/main.css index 13683c44..1a1575ca 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; +} -- 2.30.2