Move toc_aside out of <main>

This way, we avoid that the table of contents is picked for link previews by third-party sites.
This commit is contained in:
Philipp Oppermann
2020-03-27 18:02:46 +01:00
parent 6163821401
commit 74969cd1be
2 changed files with 22 additions and 17 deletions

View File

@@ -32,7 +32,10 @@
</div>
</header>
<div>
{% block toc_aside %}{% endblock toc_aside %}
<main>{% block main %}{% endblock main %}</main>
</div>
<div>{% block after_main %}{% endblock after_main %}</div>

View File

@@ -15,14 +15,8 @@
{{ page.summary | safe | striptags | truncate(length=150) }}
{%- endblock description %}
{% block main %}
<h1>{{ page.title }}</h1>
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
{{ 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-aside">
{% block toc_aside %}
<aside id="toc-aside">
<h2>Table of Contents</h2>
<ol>
{% for h2 in page.toc %}<li>
@@ -35,7 +29,15 @@
</li>{% endfor %}
<li class="toc-comments-link"><a href="#comments">Comments</a></li>
</ol>
</aside>
</aside>
{% endblock toc_aside %}
{% block main %}
<h1>{{ page.title }}</h1>
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
{{ page.date | date(format="%b %d, %Y") }}
{% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %}
</time>
{% if page.extra.warning %}
<div class="warning">
@@ -101,4 +103,4 @@
{%- endif %}
</aside>
{% endblock after_main %}
{% endblock main %}