[POC] to improve: specify other pages to build with banners
This commit is contained in:
parent
74c4be35bf
commit
95b7e74956
@ -109,7 +109,7 @@ if toctree:
|
||||
# than functions on the BuildEnv & al
|
||||
@monkey(toctree.TocTree)
|
||||
def resolve(old_resolve, tree, docname, *args, **kwargs):
|
||||
if docname == tree.env.config.master_doc:
|
||||
if docname == tree.env.config.master_doc or docname in tree.env.config.banners_doc:
|
||||
return resolve_content_toctree(tree.env, docname, *args, **kwargs)
|
||||
toc = old_resolve(tree, docname, *args, **kwargs)
|
||||
if toc is None:
|
||||
@ -124,6 +124,8 @@ def resolve_toctree(old_resolve, self, docname, *args, **kwargs):
|
||||
""" If navbar, bootstrapify TOC to yield a navbar
|
||||
|
||||
"""
|
||||
# VFE NOTE not called since sphinx 1.6
|
||||
# bump the version and remove ?
|
||||
navbar = kwargs.pop('navbar', None)
|
||||
if docname == self.config.master_doc and not navbar:
|
||||
return resolve_content_toctree(self, docname, *args, **kwargs)
|
||||
|
@ -11,6 +11,7 @@
|
||||
{% if loop.first %}
|
||||
<li><a href="{{ pathto(master_doc) }}">{{ master_doc_short_name }}</a></li>
|
||||
{% else %}
|
||||
<!-- VFE there is no elif ? -->
|
||||
{% if loop.index == 2 %}
|
||||
<li><a href="{{ parent.link|e }}">{{parent.title}}</a></li>
|
||||
{% endif %}
|
||||
|
@ -1,8 +1,11 @@
|
||||
{% extends "basic/layout.html" %}
|
||||
{% set html5_doctype = True %}
|
||||
|
||||
{# ===== VARIABLES ====== #}
|
||||
{% set banners_doc = 'user/index' %}
|
||||
|
||||
{% set classes = [] %}
|
||||
{% if pagename == master_doc %}
|
||||
{% if pagename == master_doc or pagename == banners_doc %}
|
||||
{% set classes = classes + ['index'] %}
|
||||
{% endif %}
|
||||
|
||||
@ -179,7 +182,7 @@
|
||||
</div>
|
||||
|
||||
<ul class="navbar-nav navbar-right nav o_sub_nav_actions">
|
||||
{% if pagename != master_doc %}
|
||||
{% if pagename != master_doc and pagename != banners_doc %}
|
||||
<li class="divider"></li>
|
||||
{% endif%}
|
||||
|
||||
@ -225,7 +228,7 @@
|
||||
{% set container = 'container' %}
|
||||
{% endif %}
|
||||
<main class="container {{ ' '.join(classes) }}">
|
||||
{% if pagename != master_doc %}
|
||||
{% if pagename != master_doc and pagename != banners_doc %}
|
||||
<div class="o_content row">
|
||||
{% if 'has-toc' not in meta and not (pagename in toc) %}
|
||||
<aside>
|
||||
@ -240,9 +243,10 @@
|
||||
</aside>
|
||||
{% endif %}
|
||||
<article class="doc-body {% if 'has-toc' in meta %}doc-toc{% endif %}{% if pagename in toc%}index-category{% endif %}">
|
||||
{% endif %}
|
||||
{% block body %} {% endblock %}
|
||||
{% if pagename != master_doc %}</article>
|
||||
{% endif %}
|
||||
{% block body %} {% endblock %}
|
||||
{% if pagename != master_doc and pagename != banners_doc %}
|
||||
</article>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="mask"></div>
|
||||
|
1
conf.py
1
conf.py
@ -295,6 +295,7 @@ def setup(app):
|
||||
app.connect('html-page-context', canonicalize)
|
||||
app.add_config_value('canonical_root', None, 'env')
|
||||
app.add_config_value('canonical_branch', 'master', 'env')
|
||||
app.add_config_value('banners_doc', ['user/index'], 'env')
|
||||
|
||||
app.connect('html-page-context', analytics)
|
||||
app.add_config_value('google_analytics_key', '', 'env')
|
||||
|
Loading…
Reference in New Issue
Block a user