rename 'hide_page_toc' to 'hide-page-toc' and 'show_content' to 'show-content'
This commit is contained in:
parent
dbf6320223
commit
fb935a23eb
@ -1,9 +1,7 @@
|
|||||||
:custom-css: legal.css
|
:custom-css: legal.css
|
||||||
:hide_page_toc:
|
:hide-page-toc:
|
||||||
:orphan:
|
:orphan:
|
||||||
|
|
||||||
.. hide_page_toc hides the local page toc
|
|
||||||
|
|
||||||
=====
|
=====
|
||||||
Legal
|
Legal
|
||||||
=====
|
=====
|
||||||
|
@ -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,
|
Inspect parent node's siblings to determine whether the node references a toc and, if so,
|
||||||
clear its reference URL. (<a href="#"/>)
|
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(
|
if _node_docname and any(
|
||||||
isinstance(_subnode, nodes.bullet_list)
|
isinstance(_subnode, nodes.bullet_list)
|
||||||
for _subnode in _reference_node.parent.parent.children
|
for _subnode in _reference_node.parent.parent.children
|
||||||
): # The node references a toc
|
): # 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
|
_reference_node['refuri'] = '#' # The page must not be accessible
|
||||||
|
|
||||||
def _set_docname_as_class(_reference_node, _node_docname):
|
def _set_docname_as_class(_reference_node, _node_docname):
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
{% set main_classes = main_classes + meta['classes'].split() %}
|
{% set main_classes = main_classes + meta['classes'].split() %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if 'hide_page_toc' in meta %}
|
{% if 'hide-page-toc' in meta %}
|
||||||
{% set main_classes = main_classes + ['o_fullwidth_page'] %}
|
{% set main_classes = main_classes + ['o_fullwidth_page'] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</main>
|
</main>
|
||||||
{# VFE TODO Check if this condition is still needed ??? #}
|
{# 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">
|
<aside id="o_page_toc" class="o_page_toc">
|
||||||
{% include "layout_templates/page_toc.html" %}
|
{% include "layout_templates/page_toc.html" %}
|
||||||
</aside>
|
</aside>
|
||||||
|
Loading…
Reference in New Issue
Block a user