diff options
Diffstat (limited to 'templates/page.html')
| -rw-r--r-- | templates/page.html | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/templates/page.html b/templates/page.html index 19f42a7..7120590 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,41 +1,21 @@ -{% extends "base.html" %} {% block content %} +{% extends "base.html" %} +{% import "macros.html" as macros %} +{% block content %} <h1> {{ page.title }}<br /> - <small>{{ page.date }}</small> + <small>({{ page.date }})</small> <small>[{{ page.extra.kind }}]</small> </h1> -{% block lede %} -<p>{{ page.description }}</p> -{% endblock %} - -{% block toc %} -<ul> - {% for h1 in page.toc %} - <li><a href="#{{ h1.id }}">{{ h1.title }}</a></li> - <ul> - {% for h2 in h1.children %} - <li><a href="#{{ h2.id }}">{{ h2.title }}</a></li> - <ul> - {% for h3 in h2.children %} - <li><a href="#{{ h3.id }}">{{ h3.title }}</a></li> - {% endfor %} - </ul> - {% endfor %} - </ul> - {% endfor %} -</ul> -{% endblock %} - -{{ page.content | safe }} +{{ page.content | replace(from="<!-- toc -->", to=macros::toc(page=page)) | safe }} <nav class="post-nav" aria-label="Post navigation"> - {% if page.lower %} - <div class="post-nav-left"><a class="post-nav-link" href="{{ page.lower.permalink }}">← {{ page.lower.title }}</a></div> - {% endif %} {% if page.higher %} - <div class="post-nav-right"><a class="post-nav-link" href="{{ page.higher.permalink }}">{{ page.higher.title }} →</a></div> + <div class="post-nav-left"><a class="post-nav-link" href="{{ page.higher.permalink }}">← {{ page.higher.title }}</a></div> + {% endif %} + {% if page.lower %} + <div class="post-nav-right"><a class="post-nav-link" href="{{ page.lower.permalink }}">{{ page.lower.title }} →</a></div> {% endif %} </nav> |
