Fix overlap of 'All Posts' and ToC; add comments to ToC

The 'All Posts' link used to overlap with the table of contents at the end of a post. This occured because the ToC is sticky to the `main` block, so it scrolled up before the `comments` section. The 'All Post' link, however, is fixed, so it does not scroll up.

This commit fixes the issue by moving the comment block to the main block (from the after_main block). This way, the ToC stays visible in the comment section. We also add the comment section to the ToC.
This commit is contained in:
Philipp Oppermann
2020-02-25 14:26:41 +01:00
parent 0619f3a9e7
commit acea700708
3 changed files with 6 additions and 2 deletions

View File

@@ -425,3 +425,7 @@ details summary h3, details summary h4, details summary h5, details summary h6 {
.hidden { .hidden {
display: none; display: none;
} }
.toc-comments-link {
margin-top: .5rem;
}

View File

@@ -43,6 +43,7 @@
</li>{% endfor %} </li>{% endfor %}
</ul>{% endif %} </ul>{% endif %}
</li>{% endfor %} </li>{% endfor %}
<li class="toc-comments-link"><a href="#comments">Comments</a></li>
</ul> </ul>
</details> </details>
{% endmacro toc %} {% endmacro toc %}

View File

@@ -33,6 +33,7 @@
</li>{% endfor %} </li>{% endfor %}
</ol>{% endif %} </ol>{% endif %}
</li>{% endfor %} </li>{% endfor %}
<li class="toc-comments-link"><a href="#comments">Comments</a></li>
</ol> </ol>
</aside> </aside>
@@ -70,9 +71,7 @@
<h2>Support Me</h2> <h2>Support Me</h2>
{% include "support.html" %} {% include "support.html" %}
</div> </div>
{% endblock main %}
{% block after_main %}
<hr> <hr>
<div class="PageNavigation"> <div class="PageNavigation">
{% if page.lighter %} {% if page.lighter %}