2018-05-14 15:46:41 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{{ page['title'] }}
|
|
|
|
{% endblock %}
|
|
|
|
|
2020-04-21 20:18:06 +02:00
|
|
|
{% block container %}
|
2018-05-14 15:46:41 +02:00
|
|
|
|
2021-02-02 21:05:24 +01:00
|
|
|
{% set html = page.html %}
|
|
|
|
{% if page.meta.get("toc", True) %}
|
|
|
|
<div class="container mt-4">
|
|
|
|
<main class="row">
|
|
|
|
<article class="col-md-9 content">
|
2021-02-02 21:43:10 +01:00
|
|
|
<h1 class="mb-4">{{ page['title'] }}</h1>
|
2021-02-02 21:05:24 +01:00
|
|
|
|
|
|
|
{{ html | safe }}
|
|
|
|
</article>
|
|
|
|
|
|
|
|
<nav class="col-md-3 toc">
|
|
|
|
{% set headings = get_headings(html) %}
|
|
|
|
<ul class="nav flex-column" role="menu">
|
|
|
|
{% for item in headings recursive %}
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="#{{ item.link }}">
|
|
|
|
{{ item.text }}
|
|
|
|
</a>
|
|
|
|
{% if item.children %}
|
|
|
|
<ul class="nav flex-column" role="menu">
|
|
|
|
{{ loop(item.children) }}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="container mt-4">
|
|
|
|
<article class="content">
|
2021-02-02 21:43:10 +01:00
|
|
|
<h1 class="mb-4">{{ page['title'] }}</h1>
|
2021-02-02 21:05:24 +01:00
|
|
|
|
|
|
|
{{ html | safe }}
|
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2018-05-14 15:46:41 +02:00
|
|
|
{% endblock %}
|