diff --git a/CHANGELOG b/CHANGELOG index f6c4147d8..dfaf082aa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +mkdocs-material-8.2.15+insiders-4.16.0 (2022-05-25) + + * Added support for navigation pruning + * Fixed search results for non-segmented characters (4.15.2 regression) + mkdocs-material-8.2.15+insiders-4.15.2 (2022-05-22) * Removed workaround for abbr on touch devices (superseded by tooltips) diff --git a/docs/blog/2022/chinese-search-support.md b/docs/blog/2022/chinese-search-support.md index a51146f2b..657d98abb 100644 --- a/docs/blog/2022/chinese-search-support.md +++ b/docs/blog/2022/chinese-search-support.md @@ -20,7 +20,7 @@ number of Chinese users.__ __Martin Donath__ · @squidfunk :octicons-calendar-24: May 5, 2022 · -:octicons-clock-24: 5 min read · +:octicons-clock-24: 3 min read · [:octicons-tag-24: 8.2.13+insiders-4.14.0][insiders-4.14.0] diff --git a/docs/insiders/changelog.md b/docs/insiders/changelog.md index ea9dbdf92..40c75d825 100644 --- a/docs/insiders/changelog.md +++ b/docs/insiders/changelog.md @@ -6,6 +6,9 @@ template: overrides/main.html ## Material for MkDocs Insiders +- Added support for navigation pruning +- Fixed search results for non-segmented characters (4.15.2 regression) + ### 4.15.2 _ May 22, 2022 { id="4.15.2" } - Removed workaround for `abbr` on touch devices (superseded by tooltips) diff --git a/docs/insiders/index.md b/docs/insiders/index.md index 4ab6b446e..be128feb2 100644 --- a/docs/insiders/index.md +++ b/docs/insiders/index.md @@ -174,9 +174,10 @@ which are currently exclusively available to sponsors:
+- [x] [Navigation pruning] :material-alert-decagram:{ title="Added on May 25, 2022" } - [x] [Tooltips] :material-alert-decagram:{ title="Added on May 8, 2022" } - [x] [Chinese search support] :material-alert-decagram:{ title="Added on May 5, 2022" } -- [x] [Tag icons] :material-alert-decagram:{ title="Added on April 24, 2022" } +- [x] [Tag icons] - [x] [Card grids] - [x] [Offline plugin] - [x] [Privacy plugin] @@ -266,13 +267,14 @@ are released for general availability. - [x] [Annotations] - [x] [Chinese search support] - [x] [Navigation icons] +- [x] [Navigation pruning] - [ ] Navigation status badges -- [ ] Navigation pruning - [ ] Blog [Annotations]: ../reference/annotations.md [Chinese search support]: ../blog/2022/chinese-search-support.md [Navigation icons]: ../reference/index.md#setting-the-page-icon + [Navigation pruning]: ../setup/setting.up-navigation.md#navigation-pruning #### $ 14,000 – Goat's Horn diff --git a/docs/setup/setting-up-navigation.md b/docs/setup/setting-up-navigation.md index 0a23c2633..7ed634c9b 100644 --- a/docs/setup/setting-up-navigation.md +++ b/docs/setup/setting-up-navigation.md @@ -181,6 +181,33 @@ theme: [navigation.expand enabled]: ../assets/screenshots/navigation-expand.png [navigation.expand disabled]: ../assets/screenshots/navigation.png +### Navigation pruning + +[:octicons-heart-fill-24:{ .mdx-heart } Sponsors only][Insiders]{ .mdx-insiders } · +[:octicons-tag-24: insiders-4.16.0][Insiders] · +:octicons-beaker-24: Experimental + +When pruning is enabled, only the visible navigation items are included in the +rendered HTML, __reducing the size of the built site by 33% or more__. Add the +following lines to `mkdocs.yml`: + +``` yaml +theme: + features: + - navigation.prune # (1)! +``` + +1. This feature flag is not compatible with + [`navigation.expand`][navigation.expand], as navigation expansion requires + the complete navigation structure. + +This feature flag is especially useful for documentation sites with 100+ or even +1,000+ of pages, as the navigation makes up a significant fraction of the HTML. +Navigation pruning will replace all expandable sections with links to the first +page in that section (or the section index page). + + [navigation.expand]: #navigation-expansion + ### Section index pages [:octicons-tag-24: 7.3.0][navigation.indexes support] · @@ -194,9 +221,12 @@ following lines to `mkdocs.yml`: ``` yaml theme: features: - - navigation.indexes + - navigation.indexes # (1)! ``` +1. This feature flag is not compatible with [`toc.integrate`][toc.integrate], + as sections cannot host the table of contents due to missing space. + === ":octicons-check-circle-fill-16: Enabled" [![navigation.indexes enabled]][navigation.indexes enabled] @@ -218,8 +248,6 @@ nav: - Page n: section/page-n.md ``` -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 @@ -257,9 +285,13 @@ to `mkdocs.yml`: ``` yaml theme: features: - - toc.integrate + - toc.integrate # (1)! ``` +1. This feature flag is not compatible with + [`navigation.indexes`][navigation.indexes], as sections cannot host the + table of contents due to missing space. + === ":octicons-check-circle-fill-16: Enabled" [![toc.integrate enabled]][toc.integrate enabled] @@ -268,9 +300,6 @@ theme: [![toc.integrate disabled]][toc.integrate disabled] -This feature flag is not compatible with [`navigation.indexes`] -[navigation.indexes]. - [table of contents]: extensions/python-markdown.md#table-of-contents [toc.integrate support]: https://github.com/squidfunk/mkdocs-material/releases/tag/7.3.0 [toc.integrate enabled]: ../assets/screenshots/toc-integrate.png