eww/docs/themes/book/templates/page.html
ElKowar 571f65f627 Autogen docs (#44)
* Implement simple node script

* Add zola documentation

* Add gh pages workflow

* autogen widget docs
2020-10-25 16:50:52 +01:00

40 lines
1.4 KiB
HTML

{% extends "index.html" %}
{% block content %}
<h1>{{ page.title }}</h1>
{{ page.content | safe }}
{% endblock content %}
{% block prev_link %}
{% if page.lighter %}
<a class="previous" href="{{ page.lighter.permalink }}"><</a>
{% else %}
{# No page before, find the link for the section it's in if there is one #}
{% set parent = get_section(path=page.ancestors | reverse | first) %}
<a class="previous" href="{{ parent.permalink }}"><</a>
{% endif %}
{% endblock prev_link %}
{% block next_link %}
{% if page.heavier %}
<a class="next" href="{{ page.heavier.permalink }}">></a>
{% else %}
{# No page after, find the link for the following section #}
{% set index = get_section(path="_index.md") %}
{% set found_current = false %}
{% for s in index.subsections %}
{% set subsection = get_section(path=s) %}
{% if found_current %}
<a class="next" href="{{ subsection.permalink }}">></a>
{# no break #}
{% set_global found_current = false %}
{% endif %}
{% for p in subsection.pages %}
{% if p.permalink == page.permalink %}
{% set_global found_current = true %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% endblock next_link %}