mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
46 lines
1.5 KiB
HTML
46 lines
1.5 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 index = get_section(path="_index.md") %}
|
||
|
{% for subsection in index.subsections %}
|
||
|
{% for p in subsection.pages %}
|
||
|
{% if p.permalink == page.permalink %}
|
||
|
<a class="previous" href="{{ subsection.permalink }}"><</a>
|
||
|
{% endif %}
|
||
|
{% endfor %}
|
||
|
{% endfor %}
|
||
|
{% 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 subsection in index.subsections %}
|
||
|
{% 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 %}
|