From 32f3e7af3008b76a97cc10312e79e347ce79af18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A0rin=20Gamber=C3=ACni?= Date: Sun, 26 Apr 2015 18:54:38 +0200 Subject: [PATCH 1/2] Add section "Keeping index ..." PROBLEM The instructions given for the index page doesn't work after Octopress Initial Installation. CAUSE Configuring Octopress as described at [Initial setup](http://octopress.org/docs/setup/) leads to an index page which loops over a `paginator` and not over a `site`. SOLUTION I've added the section `Keeping index installed from Octopress Initial Setup` to explain ho to make the `paginator` multilingual-aware. octopress/multilingual#12 --- README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0c52e0..6b8580a 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,44 @@ How does it work? First this plugin groups all of your posts by language. Then a have its posts filtered to display only matching languages. This also works for `site.categories` and `site.tags`. If your site uses [octopress-linkblog](https://github.com/octopress/linkblog) to publish link-posts, your `site.articles` and `site.linkposts` will be filtered as well. + +### Keeping index installed from Octopress Initial Setup + +If you had previously installed and configured Octopress as described at [Initial setup](http://octopress.org/docs/setup/) section you end up with an `index.html` which loops over a `paginator`: + + --- + layout: default + --- + +
+ {{ it | language_name }} + + + {% assign index = true %} + {% for post in paginator.posts %} + +In order to make the `paginator` aware of the multilingual configuration you need to add the [Multilingual pagination](https://github.com/octopress/paginate#user-content-multilingual-pagination) yaml front `paginate: true` to your per-language indexes: + + * `index-en.html` + * `/de/index.html` + * `/es/index.html` + +For example the `/es/index.html` will be: + + --- + layout: default + paginate: true + lang: es + --- + +
+ {% assign index = true %} + {% for post in paginator.posts %} + ... + +If your per-language indexes are still empty install the [octopress/paginate](https://github.com/octopress/paginate) in order to make Octopress able to correctly handle the yaml front `paginate: true`. + + ## Site template language dictionaries It's annoying to have to write multiple site layouts and includes when the only differences are translated words. Octopress Multilingual @@ -160,7 +198,7 @@ If no language is configured for a page or post, it will default to the site's d ``` # No page lang, site is configured lang: en -{{ lang.title }} => English title +{{ lang.title }} => English titleinde ``` Since these are Jekyll data sources, these dictionaries can also be accessed at `site.data.lang_en` and `site.data.lang_de`. This From 6b352f4068b94fb6d1099aac98b9d4c3f8737b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A0rin=20Gamber=C3=ACni?= Date: Sun, 26 Apr 2015 18:59:50 +0200 Subject: [PATCH 2/2] Revert to `English title` It is a cut and paste mistake. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b8580a..676a0e7 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ If no language is configured for a page or post, it will default to the site's d ``` # No page lang, site is configured lang: en -{{ lang.title }} => English titleinde +{{ lang.title }} => English title ``` Since these are Jekyll data sources, these dictionaries can also be accessed at `site.data.lang_en` and `site.data.lang_de`. This