diff --git a/CHANGELOG b/CHANGELOG
index ac9d858cf..2e37d0865 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+mkdocs-material-8.1.10+insiders-4.8.0 (2022-02-06)
+
+ * Added support for anchor following table of contents (= auto scroll)
+
mkdocs-material-8.1.10 (2022-02-06)
* Fixed cutoff of very wide logos in the sidebar on mobile
diff --git a/docs/insiders/changelog.md b/docs/insiders/changelog.md
index 633ed329c..bb7a344ba 100644
--- a/docs/insiders/changelog.md
+++ b/docs/insiders/changelog.md
@@ -6,6 +6,10 @@ template: overrides/main.html
## Material for MkDocs Insiders
+### 4.8.0 _ February 6, 2022 { id="4.8.0" }
+
+- Added support for anchor following table of contents (= auto scroll)
+
### 4.7.2 _ February 2, 2022 { id="4.7.2" }
- Fixed #3526: Transparent sidebar title due to Safari bug
diff --git a/docs/insiders/index.md b/docs/insiders/index.md
index 27de69629..91fb6629c 100644
--- a/docs/insiders/index.md
+++ b/docs/insiders/index.md
@@ -230,12 +230,14 @@ are released for general availability.
- [x] [Social cards]
- [x] [Code annotations: anchor links]
- [x] [Code annotations: strip comments]
+- [x] [Table of contents anchor following]
+- [x] Sidebars automatically scroll to active item
- [ ] Stay on page when switching languages
-- [ ] Sidebars automatically scroll to active item
[Social cards]: ../setup/setting-up-social-cards.md
[Code annotations: anchor links]: ../reference/code-blocks.md#anchor-links
[Code annotations: strip comments]: ../reference/code-blocks.md#stripping-comments
+ [Table of contents anchor following]: ../setup/setting-up-navigation.md#anchor-following
#### $ 10,000 – Carolina Reaper
diff --git a/docs/schema/theme.json b/docs/schema/theme.json
index 1f6970628..3dec91cb5 100644
--- a/docs/schema/theme.json
+++ b/docs/schema/theme.json
@@ -620,7 +620,14 @@
},
{
"title": "Integrated table of contents",
- "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#integrated-table-of-contents",
+ "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#anchor-following",
+ "enum": [
+ "toc.follow"
+ ]
+ },
+ {
+ "title": "Integrated table of contents",
+ "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-integration",
"enum": [
"toc.integrate"
]
diff --git a/docs/setup/setting-up-navigation.md b/docs/setup/setting-up-navigation.md
index 2b44e7919..27a2480d1 100644
--- a/docs/setup/setting-up-navigation.md
+++ b/docs/setup/setting-up-navigation.md
@@ -223,9 +223,29 @@ This feature flag is not compatible with [`toc.integrate`][toc.integrate].
[navigation.indexes support]: https://github.com/squidfunk/mkdocs-material/releases/tag/7.3.0
[navigation.indexes enabled]: ../assets/screenshots/navigation-index-on.png
[navigation.indexes disabled]: ../assets/screenshots/navigation-index-off.png
- [toc.integrate]: #integrated-table-of-contents
+ [toc.integrate]: #navigation-integration
-### Integrated table of contents
+### Table of contents
+
+#### Anchor following
+
+[:octicons-heart-fill-24:{ .mdx-heart } Insiders][Insiders]{ .mdx-insiders } ·
+[:octicons-tag-24: insiders-4.8.0][Insiders] ·
+:octicons-beaker-24: Experimental
+
+When anchor following for the [table of contents] is enabled, the sidebar is
+automatically scrolled so that the active anchor is always visible. Add the
+following lines to `mkdocs.yml`:
+
+``` yaml
+theme:
+ features:
+ - toc.follow
+```
+
+ [Insiders]: ../insiders/index.md
+
+#### Navigation integration
[:octicons-tag-24: 6.2.0][toc.integrate support] ·
:octicons-unlock-24: Feature flag
diff --git a/mkdocs.yml b/mkdocs.yml
index 943fc3cf8..83757f5da 100755
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -64,6 +64,7 @@ theme:
- search.highlight
- search.share
- search.suggest
+ - toc.follow
# - toc.integrate
palette:
- scheme: default