Let gutenberg generate the table of contents

Remove the javascript toc code.
This commit is contained in:
Philipp Oppermann
2017-10-05 11:37:23 +02:00
parent bba3c52ff3
commit dae2edfbf5
3 changed files with 19 additions and 25 deletions

View File

@@ -8,6 +8,25 @@
{{ page.date | date(format="%b %d, %Y") }}
{% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %}
</time>
<aside id="toc">
<h2>Table of Contents</h2>
<ol>
{% for h2 in page.toc %}
<li>
<a href="{{h2.permalink | safe}}">{{ h2.title }}</a>
{% if h2.children %}
<ol>
{% for h3 in h2.children %}
<li>
<a href="{{h3.permalink | safe}}">{{ h3.title }}</a>
</li>
{% endfor %}
</ol>
{% endif %}
</li>
{% endfor %}
</ol>
</aside>
{{ page.content | safe }}
{% endblock main %}