Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix hierarchical_pages README
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Apr 2, 2017
1 parent 8647fe1 commit 0c5ae0b
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions v7/hierarchical_pages/README.md
@@ -1,47 +1,50 @@
This plugin allows to translate paths by specifying paths in a hierarchy.

Assume you have the following hierarchy of posts (default language English):
- `about.rst`
- `about/company.rst`
- `about/team.rst`
- `about/team/nikola-tesla.rst`
- `about/team/roberto-alsina.rst`

* `about.rst`
* `about/company.rst`
* `about/team.rst`
* `about/team/nikola-tesla.rst`
* `about/team/roberto-alsina.rst`

Assuming you have set `PRETTY_URLS` to `True` and `SITE_URL` to `https://example.com`,
you can access the pages with the following URLs:
- `https://example.com/about/`
- `https://example.com/about/company/`
- `https://example.com/about/team/`
- `https://example.com/about/team/nikola-tesla/`
- `https://example.com/about/team/roberto-alsina/`

* `https://example.com/about/`
* `https://example.com/about/company/`
* `https://example.com/about/team/`
* `https://example.com/about/team/nikola-tesla/`
* `https://example.com/about/team/roberto-alsina/`

Now assume you want to make your homepage available in more languages, say
also in German. You want the URLs for the translated posts to be:
- `https://example.com/de/ueber/`
- `https://example.com/de/ueber/firma/`
- `https://example.com/de/ueber/mitarbeiter/`
- `https://example.com/de/ueber/mitarbeiter/nikola-tesla/`
- `https://example.com/de/ueber/mitarbeiter/roberto-alsina/`

* `https://example.com/de/ueber/`
* `https://example.com/de/ueber/firma/`
* `https://example.com/de/ueber/mitarbeiter/`
* `https://example.com/de/ueber/mitarbeiter/nikola-tesla/`
* `https://example.com/de/ueber/mitarbeiter/roberto-alsina/`

This can be achieved with the `hierarchical_pages` plugin. If you create
translations:
- `about.de.rst`
- `about/company.de.rst`
- `about/team.de.rst`
- `about/team/nikola-tesla.de.rst`
- `about/team/roberto-alsina.de.rst`

* `about.de.rst`
* `about/company.de.rst`
* `about/team.de.rst`
* `about/team/nikola-tesla.de.rst`
* `about/team/roberto-alsina.de.rst`

and use the `slug` meta data (`.. slug: xxx`) to specify the German slug,
Nikola will place the German output files so that the translations are
available under the desired URLs!

If you use plain Nikola instead, the URLs would be:
- `https://example.com/de/ueber/`
- `https://example.com/de/about/firma/`
- `https://example.com/de/about/mitarbeiter/`
- `https://example.com/de/about/team/nikola-tesla/`
- `https://example.com/de/about/team/roberto-alsina/`

Note that this plugin requires Nikola 7.8.2. In case version 7.8.2 wasn't
released yet, please use the current master. This plugin requires
[PR 2502](https://github.com/getnikola/nikola/pull/2502) to work.

* `https://example.com/de/ueber/`
* `https://example.com/de/about/firma/`
* `https://example.com/de/about/mitarbeiter/`
* `https://example.com/de/about/team/nikola-tesla/`
* `https://example.com/de/about/team/roberto-alsina/`

Note that this plugin requires Nikola 7.8.2 or newer.

0 comments on commit 0c5ae0b

Please sign in to comment.