You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/14-helpers.md
+25
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,31 @@ toc_icon: "cog"
295
295
**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`.
296
296
{: .notice--warning }
297
297
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
+
298
323
### Enabled via `toc` include (deprecated)
299
324
300
325
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