first commit
This commit is contained in:
commit
13c1ed7b2a
35 changed files with 3330 additions and 0 deletions
40
templates/page.html
Normal file
40
templates/page.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
{% extends "index.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
{{ page.content | safe }}
|
||||
{% endblock content %}
|
||||
|
||||
{% block prev_link %}
|
||||
{% if page.smaller %}
|
||||
<a class="previous" href="{{ page.smaller.permalink | safe }}"><</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 | safe }}"><</a>
|
||||
{% endif %}
|
||||
{% endblock prev_link %}
|
||||
|
||||
{% block next_link %}
|
||||
{% if page.higher %}
|
||||
<a class="next" href="{{ page.higher.permalink | safe }}">></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 | safe }}">></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 %}
|
Loading…
Add table
Add a link
Reference in a new issue