Add toc_sticky to stick table of contents
"Stick" table of contents to top of the page by adding: ``` toc: true toc_sticky: true ``` to a post or page's YAML Front Matter. Note: only supported with `single` layout.
This commit is contained in:
@@ -35,7 +35,7 @@ layout: default
|
||||
|
||||
<section class="page__content" itemprop="text">
|
||||
{% if page.toc %}
|
||||
<aside class="sidebar__right">
|
||||
<aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
|
||||
<nav class="toc">
|
||||
<header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label }}</h4></header>
|
||||
{% include toc.html sanitize=true html=content h_min=2 h_max=3 class="toc__menu" %}
|
||||
|
||||
Reference in New Issue
Block a user