aboutsummaryrefslogtreecommitdiff
path: root/templates/page.html
blob: 6ea50d607142ff3e49169d87bc75f29182695840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{% extends "base.html" %}
{% import "macros/macros.html" as macros %}
{%- block content %}
    <article>
    {{- macros::title(page=page) }}
    {{ page.content | safe }}
    {%- block page_footer %}
    {{- macros::footer(page=page) }}
    {%- endblock page_footer %}
    </article>
    {%- block toc %}
    {%- if page.extra.toc %}
    {%- set toc = page.toc %}
    {%- endif %}
    {%- if toc %}
    <div class="toc">
      <div class="toc-sticky">
        <h3>Index</h3>
        {%- for h in toc %}
        <div class="toc-item">
          <a class="subtext" href="{{h.permalink | safe}}">{{ h.title }}</a>
        </div>
        {%- if h.children %}
        {%- for h2 in h.children %}
        <div class="toc-item-child">
          <a class="subtext" href="{{h2.permalink | safe}}"><small>- {{ h2.title }}</small></a>
        </div>
        {%- endfor %}
        {%- endif %}
        {%- endfor %}
      </div>
    </div>
    {%- endif %}
    {%- endblock toc %}
{%- endblock content %}