diff --git a/conf.py b/conf.py index 79ad5c702..836a3efdc 100644 --- a/conf.py +++ b/conf.py @@ -244,8 +244,6 @@ def setup(app): app.add_config_value('languages', None, 'env') app.connect('html-page-context', _generate_alternate_urls) - app.connect('doctree-resolved', tag_toctrees) # TODO ANVFE review + typo - def _generate_alternate_urls(app, pagename, templatename, context, doctree): """ Add keys of required alternate URLs for the current document in the rendering context. @@ -319,24 +317,3 @@ def _generate_alternate_urls(app, pagename, templatename, context, doctree): _canonicalize() _versionize() _localize() - - -def tag_toctrees(app, doctree, docname): - """Add a 'has_only_toc' metadata entry to all documents containing only a toctree node""" - # document - # section - # title - # compound@toctree-wrapper - # .... - if not len(doctree.children) <= 1: - return - section = doctree.children[0] - if len(section.children) < 2: - return - compound = section.children[1] - if 'toctree-wrapper' not in compound['classes']: - return - - if 'show_content' not in app.env.metadata[docname]: - # If page contains custom content: we have to show github link and local toc - app.env.metadata[docname]['has_only_toc'] = True diff --git a/content/applications.rst b/content/applications.rst index 8ea646be5..3f4f12d2f 100644 --- a/content/applications.rst +++ b/content/applications.rst @@ -1,4 +1,5 @@ :show_content: +:hide_page_toc: ============ Applications diff --git a/content/contributing/documentation.rst b/content/contributing/documentation.rst index 81b3bef70..63b1b6882 100644 --- a/content/contributing/documentation.rst +++ b/content/contributing/documentation.rst @@ -1,5 +1,5 @@ - :show_content: +:hide_page_toc: ================================= Contributing to the documentation diff --git a/extensions/odoo_theme/layout.html b/extensions/odoo_theme/layout.html index 35c0c210a..a9b1808aa 100644 --- a/extensions/odoo_theme/layout.html +++ b/extensions/odoo_theme/layout.html @@ -83,7 +83,7 @@ {% set main_classes = main_classes + meta['classes'].split() %} {% endif %} - {% if 'has_only_toc' in meta or 'hide_page_toc' in meta %} + {% if 'hide_page_toc' in meta %} {% set main_classes = main_classes + ['o_fullwidth_page'] %} {% endif %} @@ -101,7 +101,7 @@ {% block body %} {% endblock %} {# Do not show the edition link for pages without content #} - {% if github_link and 'has_only_toc' not in meta and pagename != 'search' %} + {% if github_link and pagename != 'search' %} Edit on GitHub {% endif %}