drallgood/jekyll-multilingual — pull request #2 by siefca (2014-12-21 23:04:06+00:00)
Title: A root language support

A root language is a special language that causes pages to be left alone, even if there is a default language set. It is helpful in cases where there is a need for a page that has no language assigned to it and its place is static.

Example: We're hosting my blog on github pages and I want index page to be a gateway where visitor has to select language (or it's selected by JavaScript after analyzing Accept header reflected by some external server).

To achieve that we should be able to create a kind of meta-index in a root directory of our blog and disable shadowing of that file by any version of language-generated index. So we have two indexes: one is for /[lang] subdirectories and second is for a root directory.

Steps:

1. Create `source/index-root.html` with custom welcome message and a header:

```
---
layout: root
permalink: /index.html
language: root
---
Please select language...
```

2. Create `source/_layouts/root.html` if needed (to include `head.html` and so on), example:

```
{% capture root_url %}{{ site.root | strip_slash }}{% endcapture %}
{% include head.html %}

{{ content | expand_urls: root_url }}

```