Skip to content

Commit ac40a93

Browse files
iBugchukycheese
authored andcommitted
Add note on TOC heading level issue (mmistakes#2902)
mmistakes#2892 (comment)
1 parent f3df28b commit ac40a93

File tree

3 files changed

+59
-5
lines changed

3 files changed

+59
-5
lines changed

.gitattributes

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
assets/fonts/* linguist-vendored
2-
assets/js/main.min.js linguist-vendored
3-
assets/js/lunr/* linguist-vendored
4-
assets/js/plugins/* linguist-vendored
5-
assets/js/vendor/* linguist-vendored
1+
assets/fonts/* linguist-vendored
2+
assets/js/main.min.js linguist-vendored
3+
assets/js/lunr/* linguist-vendored
4+
assets/js/plugins/* linguist-vendored
5+
assets/js/vendor/* linguist-vendored
66
_sass/minimal-mistakes/vendor/* linguist-vendored
7+
CHANGELOG.md text merge=union
8+
docs/_docs/18-history.md text merge=union
9+
10+
*.md text

docs/_docs/10-layouts.md

+25
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,31 @@ toc_icon: "cog"
141141
---
142142
```
143143

144+
{% capture notice-text %}
145+
**Note:** You need to use contiguous levels of headings for the TOC to generate properly. For example:
146+
147+
```markdown
148+
Good headings:
149+
150+
# Heading
151+
## Heading
152+
### Heading
153+
### Heading
154+
# Heading
155+
## Heading
156+
157+
Bad headings:
158+
159+
# Heading
160+
### Heading (skipped H2)
161+
##### Heading (skipped H4)
162+
```
163+
{% endcapture %}
164+
165+
<div class="notice--warning">
166+
{{ notice-text | markdownify }}
167+
</div>
168+
144169
## Archive layout
145170

146171
Essentially the same as `single` with markup adjustments and some modules removed.

docs/_docs/14-helpers.md

+25
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,31 @@ toc_icon: "cog"
295295
**Note:** using both methods will have unintended results. Be sure to remove `{% raw %}{% include toc %}{% endraw %}` placed table of contents from your content when using `toc: true`.
296296
{: .notice--warning }
297297

298+
{% capture notice-text %}
299+
**Note:** You need to use contiguous levels of headings for the TOC to generate properly. For example:
300+
301+
```markdown
302+
Good headings:
303+
304+
# Heading
305+
## Heading
306+
### Heading
307+
### Heading
308+
# Heading
309+
## Heading
310+
311+
Bad headings:
312+
313+
# Heading
314+
### Heading (skipped H2)
315+
##### Heading (skipped H4)
316+
```
317+
{% endcapture %}
318+
319+
<div class="notice--warning">
320+
{{ notice-text | markdownify }}
321+
</div>
322+
298323
### Enabled via `toc` include (deprecated)
299324

300325
To include a Kramdown [auto-generated table of contents](https://kramdown.gettalong.org/converter/html.html#toc) for posts and pages, add the following helper to your content.

0 commit comments

Comments
 (0)