Skip to content

Commit eaf9286

Browse files
committed
Allow heading levels 1-6 in table of contents
Adjust minimum and maximum levels to allow all headings and fix CSS to style indentation and nested lists properly in jekyll-toc and Kramdown generated table of contents. Fixes mmistakes#1782
1 parent 75ad58d commit eaf9286

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

_layouts/single.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
3939
<nav class="toc">
4040
<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>
41-
{% include toc.html sanitize=true html=content h_min=2 h_max=3 class="toc__menu" %}
41+
{% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" %}
4242
</nav>
4343
</aside>
4444
{% endif %}

_sass/minimal-mistakes/_navigation.scss

+14-7
Original file line numberDiff line numberDiff line change
@@ -540,16 +540,23 @@
540540
}
541541

542542
li ul > li a {
543-
padding-left: 1.75rem;
543+
padding-left: 1.5rem;
544544
font-weight: normal;
545545
}
546546

547-
/* hide sub sub links on small screens*/
548-
li > ul li {
549-
display: none;
547+
li ul li ul > li a {
548+
padding-left: 2rem;
549+
}
550550

551-
@include breakpoint($medium) {
552-
display: block;
553-
}
551+
li ul li ul li ul > li a {
552+
padding-left: 2.5rem;
553+
}
554+
555+
li ul li ul li ul li ul > li a {
556+
padding-left: 3rem;
557+
}
558+
559+
li ul li ul li ul li ul li ul > li a {
560+
padding-left: 3.5rem
554561
}
555562
}

0 commit comments

Comments
 (0)