Make location of buttons configurable

Add the `prev_next_buttons_location` variable which understand `top`,
`bottom`, `both`.Any other value will not display the next and previous
buttons.

Not setting the value leave it to `bottom` by default.
This commit is contained in:
Matthias Bussonnier 2016-10-09 10:18:49 -07:00
parent 42e4fc0bbb
commit 01707b94f5
4 changed files with 7 additions and 1 deletions

View File

@ -102,6 +102,9 @@ v0.1.10-alpha
* Removes Sphinx dependency
* Fixes hamburger on mobile display
* Adds a ``body_begin`` block to the template
* Add ``prev_next_buttons_location`` which can take the value ``bottom``,
``top``, ``both`` , ``None`` and will display the "Next" and "Previous"
buttons accordingly
v0.1.9
------

View File

@ -57,6 +57,7 @@
{% endblock %}
</ul>
{% if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="breadcrumb navigation">
{% if next %}
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
@ -65,5 +66,6 @@
<a href="{{ prev.link|e }}" class="btn btn-neutral" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
{% endif %}
</div>
{% endif %}
<hr/>
</div>

View File

@ -1,5 +1,5 @@
<footer>
{% if next or prev %}
{% if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
{% if next %}
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>

View File

@ -10,3 +10,4 @@ logo_only =
collapse_navigation = False
display_version = True
navigation_depth = 4
prev_next_buttons_location = bottom