rename 'hide_page_toc' to 'hide-page-toc' and 'show_content' to 'show-content'

This commit is contained in:
Antoine Vandevenne (anv) 2021-04-02 17:26:09 +02:00
parent dbf6320223
commit fb935a23eb
3 changed files with 5 additions and 7 deletions

View File

@ -1,9 +1,7 @@
:custom-css: legal.css
:hide_page_toc:
:hide-page-toc:
:orphan:
.. hide_page_toc hides the local page toc
=====
Legal
=====

View File

@ -78,13 +78,13 @@ def resolve(old_resolve, tree, docname, *args, **kwargs):
Inspect parent node's siblings to determine whether the node references a toc and, if so,
clear its reference URL. (<a href="#"/>)
If the page has the `show_content` metadata, don't clear the reference.
If the page has the `show-content` metadata, don't clear the reference.
"""
if _node_docname and any(
isinstance(_subnode, nodes.bullet_list)
for _subnode in _reference_node.parent.parent.children
): # The node references a toc
if 'show_content' not in tree.env.metadata[_node_docname]:
if 'show-content' not in tree.env.metadata[_node_docname]:
_reference_node['refuri'] = '#' # The page must not be accessible
def _set_docname_as_class(_reference_node, _node_docname):

View File

@ -87,7 +87,7 @@
{% set main_classes = main_classes + meta['classes'].split() %}
{% endif %}
{% if 'hide_page_toc' in meta %}
{% if 'hide-page-toc' in meta %}
{% set main_classes = main_classes + ['o_fullwidth_page'] %}
{% endif %}
@ -113,7 +113,7 @@
{% endif %}
</main>
{# VFE TODO Check if this condition is still needed ??? #}
{% if pagename not in toc and 'hide_page_toc' not in meta %}
{% if pagename not in toc and 'hide-page-toc' not in meta %}
<aside id="o_page_toc" class="o_page_toc">
{% include "layout_templates/page_toc.html" %}
</aside>