2020-09-09 01:10:48 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block title %}{{ page.title }} - Hazelnut{% endblock title %}
|
|
|
|
|
|
|
|
{% block content %}
|
2020-12-21 14:49:03 +00:00
|
|
|
|
2020-12-23 18:23:38 +00:00
|
|
|
<h1 class="post-title">{{ page.title }}</h1>
|
|
|
|
<p class="post-date">{{ page.date | date() }}</p>
|
|
|
|
|
2020-12-21 14:49:03 +00:00
|
|
|
{% if page.extra.toc %}
|
|
|
|
<h1>Table of Contents <span id="toc-toggle">[-]</span></h1>
|
|
|
|
<div id="toc">
|
2020-09-09 01:10:48 +00:00
|
|
|
<ul>
|
|
|
|
{% for h1 in page.toc %}
|
|
|
|
<li>
|
2020-09-09 02:47:54 +00:00
|
|
|
<a class="internal" href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
2020-09-09 01:10:48 +00:00
|
|
|
{% if h1.children %}
|
|
|
|
<ul>
|
|
|
|
{% for h2 in h1.children %}
|
|
|
|
<li>
|
2020-09-09 02:47:54 +00:00
|
|
|
<a class="internal" href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
2020-09-09 01:10:48 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2020-12-21 14:49:03 +00:00
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
var shown = false;
|
|
|
|
var toggle = document.getElementById("toc-toggle");
|
|
|
|
var toc = document.getElementById("toc");
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
if (shown) {
|
|
|
|
toc.style.display = "block";
|
|
|
|
toggle.innerHTML = "[-]";
|
|
|
|
} else {
|
|
|
|
toc.style.display = "none";
|
|
|
|
toggle.innerHTML = "[+]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
toggle.parentNode.addEventListener("click", function() {
|
|
|
|
shown = !shown;
|
|
|
|
update();
|
|
|
|
});
|
|
|
|
|
|
|
|
update();
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
2020-09-09 01:10:48 +00:00
|
|
|
|
|
|
|
{{ page.content | safe }}
|
2020-12-21 14:49:03 +00:00
|
|
|
|
2020-09-09 01:10:48 +00:00
|
|
|
{% endblock content %}
|