For the record, this solution is much more complicated than the solution, but at the moment I do not find something better ...
First of all you need to understand, my workaround is topic-based. You use a theme in your document (the default is one or a custom one), but in any case you use a theme. This topic is divided into another part (page, toc, ...), which can be individually redefined. This redefinition can be performed at a different level: the theme itself or in the directory of custom project templates (by default _templates ) (configured in conf.py ).
My workaround is to override the page.html template in the page.html directory, which represents all the pages in your documentation. In this template, you have access to pagename (relative path to the document for each file). Knowing this, you can do some conditional checking in this template to determine if this is the file you want to override, and then override. If this is not a file to be redefined, simply undo the default behavior:
{% extends "layout.html" %} {% block body %} {% if pagename == 'index' %} {% include 'custom/index.html' %} {% else %} {{ body }} {% endif %} {% endblock %}
They explain that it really sounds like a hack ...
egeloen
source share