Link to #id instead of permalink in TOC

This makes table of content links also work in deploy previews.
This commit is contained in:
Philipp Oppermann
2018-01-19 14:33:49 +01:00
parent 25441a8773
commit d38e97ee0b
2 changed files with 4 additions and 4 deletions

View File

@@ -12,10 +12,10 @@
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<ol> <ol>
{% for h2 in page.toc %}<li> {% for h2 in page.toc %}<li>
<a href="{{h2.permalink | safe}}">{{ h2.title | safe }}</a> <a href="#{{h2.id | safe}}">{{ h2.title | safe }}</a>
{% if h2.children %}<ol> {% if h2.children %}<ol>
{% for h3 in h2.children %}<li> {% for h3 in h2.children %}<li>
<a href="{{h3.permalink | safe}}">{{ h3.title | safe }}</a> <a href="#{{h3.id | safe}}">{{ h3.title | safe }}</a>
</li>{% endfor %} </li>{% endfor %}
</ol>{% endif %} </ol>{% endif %}
</li>{% endfor %} </li>{% endfor %}

View File

@@ -12,10 +12,10 @@
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<ol> <ol>
{% for h2 in page.toc %}<li> {% for h2 in page.toc %}<li>
<a href="{{h2.permalink | safe}}">{{ h2.title | safe }}</a> <a href="#{{h2.id | safe}}">{{ h2.title | safe }}</a>
{% if h2.children %}<ol> {% if h2.children %}<ol>
{% for h3 in h2.children %}<li> {% for h3 in h2.children %}<li>
<a href="{{h3.permalink | safe}}">{{ h3.title | safe }}</a> <a href="#{{h3.id | safe}}">{{ h3.title | safe }}</a>
</li>{% endfor %} </li>{% endfor %}
</ol>{% endif %} </ol>{% endif %}
</li>{% endfor %} </li>{% endfor %}