GitHub

Article Table of Contents

Long articles with multiple sections should have a table of contents with schema markup

Long articles with multiple sections should have a table of contents with schema markup

Rule IDcontent/article-toc
CategoryContent
ScopePer-page
Severityinfo
Weight3/10

Solution

Add a table of contents with links to each section. Mark it up with ItemList schema containing ListItem elements with position, name, and url (fragment identifier) properties.

The rule only applies to article pages that are long (by min_word_count) or have several section headings (by min_headings), and warns when the table of contents is missing or present without ItemList schema.

Options

This rule supports the following configuration options:

OptionTypeDefaultDescription
min_word_countnumber1500Minimum article length (words) before a table of contents is expected
min_headingsnumber3Minimum number of h2/h3 section headings before a table of contents is expected

Configuration Example

squirrel.toml
toml
[rules."content/article-toc"]
min_word_count = 1500
min_headings = 3

Enable / Disable

Disable this rule

squirrel.toml
toml
[rules]
disable = ["content/article-toc"]

Disable all Content rules

squirrel.toml
toml
[rules]
disable = ["content/*"]

Enable only this rule

squirrel.toml
toml
[rules]
enable = ["content/article-toc"]
disable = ["*"]

Type to search…

↑↓ navigate ↵ open esc close