Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note on TOC heading level issue #2902

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
assets/fonts/* linguist-vendored
assets/js/main.min.js linguist-vendored
assets/js/lunr/* linguist-vendored
assets/js/plugins/* linguist-vendored
assets/js/vendor/* linguist-vendored
assets/fonts/* linguist-vendored
assets/js/main.min.js linguist-vendored
assets/js/lunr/* linguist-vendored
assets/js/plugins/* linguist-vendored
assets/js/vendor/* linguist-vendored
_sass/minimal-mistakes/vendor/* linguist-vendored
CHANGELOG.md text merge=union
docs/_docs/18-history.md text merge=union

*.md text
25 changes: 25 additions & 0 deletions docs/_docs/10-layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Essentially the same as `single` with markup adjustments and some modules removed.
Expand Down
25 changes: 25 additions & 0 deletions docs/_docs/14-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
{: .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)

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.
Expand Down