This plugin allows to translate paths by specifying paths in a hierarchy.
Assume you have the following hierarchy of posts (default language English):
Assuming you have set
you can access the pages with the following URLs:
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:
This can be achieved with the
hierarchical_pages plugin. If you create
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:
Note that this plugin requires Nikola 7.8.2 or newer.
# Use hierarchical pages instead of pages: PAGES = ( ) HIERARCHICAL_PAGES = ( ("pages/*.rst", "", "story.tmpl"), ("pages/*.txt", "", "story.tmpl"), ("pages/*.html", "", "story.tmpl"), ) # Warning: if you use Nikola before v7.8.5, all wildcards # for compilers used in HIERARCHICAL_PAGES must be listed # in PAGES or POSTS (or both) as well! # (See https://github.com/getnikola/nikola/issues/2496) # This can be achieved as follows in the above example: # # PAGES = ( # ("does_not_exist/*.rst", "", "story.tmpl"), # ("does_not_exist/*.txt", "", "story.tmpl"), # ("does_not_exist/*.html", "", "story.tmpl"), # )
You can report issues with this plugin and request help via GitHub Issues.