Add note on TOC heading level issue (#2902)
https://github.com/mmistakes/minimal-mistakes/issues/2892#issuecomment-809220952
This commit is contained in:
parent
3d3cb58a2e
commit
641ca6f3d8
3 changed files with 59 additions and 5 deletions
4
.gitattributes
vendored
4
.gitattributes
vendored
|
@ -4,3 +4,7 @@ assets/js/lunr/* linguist-vendored
|
||||||
assets/js/plugins/* linguist-vendored
|
assets/js/plugins/* linguist-vendored
|
||||||
assets/js/vendor/* linguist-vendored
|
assets/js/vendor/* linguist-vendored
|
||||||
_sass/minimal-mistakes/vendor/* linguist-vendored
|
_sass/minimal-mistakes/vendor/* linguist-vendored
|
||||||
|
CHANGELOG.md text merge=union
|
||||||
|
docs/_docs/18-history.md text merge=union
|
||||||
|
|
||||||
|
*.md text
|
||||||
|
|
|
@ -141,6 +141,31 @@ toc_icon: "cog"
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% capture notice-text %}
|
||||||
|
**Note:** You need to use contiguous levels of headings for the TOC to generate properly. For example:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
Good headings:
|
||||||
|
|
||||||
|
# Heading
|
||||||
|
## Heading
|
||||||
|
### Heading
|
||||||
|
### Heading
|
||||||
|
# Heading
|
||||||
|
## Heading
|
||||||
|
|
||||||
|
Bad headings:
|
||||||
|
|
||||||
|
# Heading
|
||||||
|
### Heading (skipped H2)
|
||||||
|
##### Heading (skipped H4)
|
||||||
|
```
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
<div class="notice--warning">
|
||||||
|
{{ notice-text | markdownify }}
|
||||||
|
</div>
|
||||||
|
|
||||||
## Archive layout
|
## Archive layout
|
||||||
|
|
||||||
Essentially the same as `single` with markup adjustments and some modules removed.
|
Essentially the same as `single` with markup adjustments and some modules removed.
|
||||||
|
|
|
@ -295,6 +295,31 @@ toc_icon: "cog"
|
||||||
**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`.
|
**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`.
|
||||||
{: .notice--warning }
|
{: .notice--warning }
|
||||||
|
|
||||||
|
{% capture notice-text %}
|
||||||
|
**Note:** You need to use contiguous levels of headings for the TOC to generate properly. For example:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
Good headings:
|
||||||
|
|
||||||
|
# Heading
|
||||||
|
## Heading
|
||||||
|
### Heading
|
||||||
|
### Heading
|
||||||
|
# Heading
|
||||||
|
## Heading
|
||||||
|
|
||||||
|
Bad headings:
|
||||||
|
|
||||||
|
# Heading
|
||||||
|
### Heading (skipped H2)
|
||||||
|
##### Heading (skipped H4)
|
||||||
|
```
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
<div class="notice--warning">
|
||||||
|
{{ notice-text | markdownify }}
|
||||||
|
</div>
|
||||||
|
|
||||||
### Enabled via `toc` include (deprecated)
|
### Enabled via `toc` include (deprecated)
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
Loading…
Reference in a new issue