aboutsummaryrefslogtreecommitdiff
path: root/templates/page.html
blob: b759184cc429c7c78fef275bba5e275ee752e26c (plain) (blame)
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
36
37
38
39
40
41
42
{% extends "base.html" %}

{% block css %}
<link rel="stylesheet" href="/syntax-theme-dark.css" media="(prefers-color-scheme: dark)">
<link rel="stylesheet" href="/syntax-theme-light.css" media="(prefers-color-scheme: light)">
<link rel="stylesheet" href="/styles.css">
{% endblock css %}

{% block content %}
<section class="post-metadata">
    <h1>{{ page.title }}</h1>
    {% if page.date %}
    <p><time datetime="{{ page.date | date(format='%Y-%m-%d %H:%M:%S') }}">{{ page.date }}</time></p>
    {% endif %}
    <p>{{ page.word_count }} words; {{ page.reading_time }} minute(s)</p>
{% if page.toc %}
    <details open>
        <summary>Table of Contents</summary>
        <nav class="page-nav">
            <ul>
            {% for h1 in page.toc %}
                <li>
                    <a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
                    {% if h1.children %}
                        <ul>
                            {% for h2 in h1.children %}
                                <li>
                                    <a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
                                </li>
                            {% endfor %}
                        </ul>
                    {% endif %}
                </li>
            {% endfor %}
            </ul>
        </nav>
    </details>
{% endif %}
</section>

{{ page.content | safe }}
{% endblock content %}