I'm building documentation with Sphinx and rST. The docs are internationalized and deployed to paths like this:
website.tld/en/index.html
website.tld/de/index.html
Now on each page I'd like to give a link to the same page in different languages. Current language is available as the language
variable, and the list of all languages is explicitly added to the html_context
and, thus, also available.
What I struggle with is the relative path to each document. Say, there's a source document at ./source/somepath/docname.rst
. It builds into these:
website.tld/en/somepath/docname.html
website.tld/de/somepath/docname.html
In the Jinja2 template, how do I get the "somepath/docname.html"
value?