mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
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:
@@ -32,7 +32,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>{% block main %}{% endblock main %}</main>
|
<div>
|
||||||
|
{% block toc_aside %}{% endblock toc_aside %}
|
||||||
|
<main>{% block main %}{% endblock main %}</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>{% block after_main %}{% endblock after_main %}</div>
|
<div>{% block after_main %}{% endblock after_main %}</div>
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,23 @@
|
|||||||
{{ page.summary | safe | striptags | truncate(length=150) }}
|
{{ page.summary | safe | striptags | truncate(length=150) }}
|
||||||
{%- endblock description %}
|
{%- endblock description %}
|
||||||
|
|
||||||
|
{% block toc_aside %}
|
||||||
|
<aside id="toc-aside">
|
||||||
|
<h2>Table of Contents</h2>
|
||||||
|
<ol>
|
||||||
|
{% for h2 in page.toc %}<li>
|
||||||
|
<a href="#{{h2.id | safe}}">{{ h2.title | safe }}</a>
|
||||||
|
{% if h2.children %}<ol>
|
||||||
|
{% for h3 in h2.children %}<li>
|
||||||
|
<a href="#{{h3.id | safe}}">{{ h3.title | safe }}</a>
|
||||||
|
</li>{% endfor %}
|
||||||
|
</ol>{% endif %}
|
||||||
|
</li>{% endfor %}
|
||||||
|
<li class="toc-comments-link"><a href="#comments">Comments</a></li>
|
||||||
|
</ol>
|
||||||
|
</aside>
|
||||||
|
{% endblock toc_aside %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
|
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
|
||||||
@@ -22,21 +39,6 @@
|
|||||||
{% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %}
|
{% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %}
|
||||||
</time>
|
</time>
|
||||||
|
|
||||||
<aside id="toc-aside">
|
|
||||||
<h2>Table of Contents</h2>
|
|
||||||
<ol>
|
|
||||||
{% for h2 in page.toc %}<li>
|
|
||||||
<a href="#{{h2.id | safe}}">{{ h2.title | safe }}</a>
|
|
||||||
{% if h2.children %}<ol>
|
|
||||||
{% for h3 in h2.children %}<li>
|
|
||||||
<a href="#{{h3.id | safe}}">{{ h3.title | safe }}</a>
|
|
||||||
</li>{% endfor %}
|
|
||||||
</ol>{% endif %}
|
|
||||||
</li>{% endfor %}
|
|
||||||
<li class="toc-comments-link"><a href="#comments">Comments</a></li>
|
|
||||||
</ol>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
{% if page.extra.warning %}
|
{% if page.extra.warning %}
|
||||||
<div class="warning">
|
<div class="warning">
|
||||||
{% if page.extra.warning_short %} <b>{{ page.extra.warning_short }}</b> {% endif %}
|
{% if page.extra.warning_short %} <b>{{ page.extra.warning_short }}</b> {% endif %}
|
||||||
@@ -101,4 +103,4 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
{% endblock after_main %}
|
{% endblock main %}
|
||||||
|
|||||||
Reference in New Issue
Block a user