From 01fdf2648613a93b0880a08df0054e938a98c5b9 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 27 Sep 2020 12:05:16 +0200 Subject: [PATCH] Updated upgrading guide and changelog --- docs/changelog.md | 11 + docs/customization.md | 1 - docs/upgrading.md | 1655 ++++++++++++++++++++++++----------------- 3 files changed, 970 insertions(+), 697 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 271e07db4..454399b3f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -42,6 +42,17 @@ template: overrides/main.html ## Material for MkDocs +### 6.0.0 _ September 25, 2020 + +* Improved search result look and feel +* Improved search result stability while typing +* Improved search result grouping (pages + headings) +* Improved search result relevance and scoring +* Added display of missing query terms to search results +* Reduced size of the Docker image to improve CI build performance +* Removed hero partial in favor of custom implementation +* Removed deprecated front matter features + ### 5.5.14 _ September 23, 2020 * Improved spacing around image captions diff --git a/docs/customization.md b/docs/customization.md index 0dae84f5c..0608ef9a3 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -115,7 +115,6 @@ The directory layout of the theme is as follows: │ ├─ language/ # Localized languages │ ├─ footer.html # Footer bar │ ├─ header.html # Header bar -│ ├─ hero.html # Hero teaser │ ├─ language.html # Localized labels │ ├─ logo.html # Logo in header and sidebar │ ├─ nav.html # Main navigation diff --git a/docs/upgrading.md b/docs/upgrading.md index 1e7994a18..d2b1cef92 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -16,29 +16,21 @@ Inspect the currently installed version with: pip show mkdocs-material ``` -## Upgrading from 4.x to 5.x +## Upgrading from 5.x to 6.x ### What's new? -* Reactive architecture – try `app.dialog$.next("Hi!")` in the console -* [Instant loading][1] – make Material behave like a Single Page Application -* Improved CSS customization with [CSS variables][2] – set your brand's colors -* Improved CSS resilience, e.g. proper sidebar locking for customized headers -* Improved [icon integration][3] and configuration – now including over 5k icons -* Added possibility to use any icon for logo, repository and social links -* Search UI does not freeze anymore (moved to web worker) -* Search index built only once when using instant loading -* Improved extensible keyboard handling -* Support for [prebuilt search indexes][4] -* Support for displaying stars and forks for GitLab repositories -* Support for scroll snapping of sidebars and search results -* Reduced HTML and CSS footprint due to deprecation of Internet Explorer support -* Slight facelifting of some UI elements (Admonitions, tables, ...) +* Improved search result look and feel +* Improved search result stability while typing +* Improved search result grouping (pages + headings) +* Improved search result relevance and scoring +* Added display of missing query terms to search results +* Reduced size of the Docker image to improve CI build performance +* Removed hero partial in favor of [custom implementation][1] +* Removed [deprecated front matter features][2] - [1]: setup/setting-up-navigation.md#instant-loading - [2]: setup/changing-the-colors.md#custom-colors - [3]: setup/changing-the-logo-and-icons.md#icons - [4]: setup/setting-up-site-search.md#built-in-search + [1]: http://localhost:8000/deprecations/#hero + [2]: http://localhost:8000/deprecations/#front-matter ### Changes to `mkdocs.yml` @@ -48,7 +40,280 @@ does not contain the key, you can skip it. #### `theme.feature` -Optional features like [tabs][5] and [instant loading][1] are now implemented as +All feature flags that can be set from `mkdocs.yml`, like [tabs][3] and +[instant loading][4], are now prefixed with the name of the component or +function they apply to, e.g. `navigation.*`: + +=== "6.x" + + ``` yaml + theme: + features: + - navigation.tabs + - navigation.instant + ``` + +=== "5.x" + + ``` yaml + theme: + features: + - tabs + - instant + ``` + + [3]: setup/setting-up-navigation.md#navigation-tabs + [4]: setup/setting-up-navigation.md#instant-loading + +### Changes to `*.html` files + +The templates have undergone a set of changes to make them future-proof. If +you've used theme extension to override a block or template, make sure that it +matches the new structure: + +- If you've overridden a **block**, check `base.html` for potential changes +- If you've overridden a **template**, check the respective `*.html` file for + potential changes + +??? quote "`base.html`" + + ``` diff + @@ -22,13 +22,6 @@ + + {% import "partials/language.html" as lang with context %} + + - + -{% set palette = config.theme.palette %} + -{% if not palette is mapping %} + - {% set palette = palette | first %} + -{% endif %} + -{% set font = config.theme.font %} + - + + + + @@ -45,21 +38,8 @@ + + {% endif %} + + - + - {% if page and page.meta and page.meta.redirect %} + - + - + - + - + - + - + - + + - {% elif page.canonical_url %} + + {% if page.canonical_url %} + + {% endif %} + + @@ -96,20 +76,21 @@ + + + + - {% if palette.scheme or palette.primary or palette.accent %} + + {% if config.theme.palette %} + + {% set palette = config.theme.palette %} + + - {% endif %} + + - + - {% if palette.primary %} + - {% import "partials/palette.html" as map %} + - {% set primary = map.primary( + - palette.primary | replace(" ", "-") | lower + - ) %} + - + + + + {% if palette.primary %} + + {% import "partials/palette.html" as map %} + + {% set primary = map.primary( + + palette.primary | replace(" ", "-") | lower + + ) %} + + + + {% endif %} + {% endif %} + {% endblock %} + + @@ -120,7 +101,8 @@ + {% block fonts %} + + + - {% if font != false %} + + {% if config.theme.font != false %} + + {% set font = config.theme.font %} + + + {% set direction = config.theme.direction or lang.t('direction') %} + - {% if palette.scheme or palette.primary or palette.accent %} + - {% set scheme = palette.scheme | lower %} + + {% if config.theme.palette %} + + {% set palette = config.theme.palette %} + + {% if not palette is mapping %} + + {% set palette = palette | first %} + + {% endif %} + + {% set scheme = palette.scheme | replace(" ", "-") | lower %} + {% set primary = palette.primary | replace(" ", "-") | lower %} + {% set accent = palette.accent | replace(" ", "-") | lower %} + + + + + + + {% if "preference" == scheme %} + + + + {% endif %} + + + {% else %} + + {% endif %} + + - + - {% if "preference" == palette.scheme %} + - + - {% endif %} + - + + - {% block hero %} + - {% if page and page.meta and page.meta.hero %} + - {% include "partials/hero.html" with context %} + - {% endif %} + - {% endblock %} + + {% block hero %}{% endblock %} + + + {% block tabs %} + - {% if "tabs" in config.theme.features %} + + {% if "navigation.tabs" in config.theme.features %} + {% include "partials/tabs.html" %} + {% endif %} + {% endblock %} + @@ -310,13 +293,6 @@ + + {% endif %} + + - + - {% block source %} + - {% if page and page.meta and page.meta.source %} + - {% include "partials/source-link.html" %} + - {% endif %} + - {% endblock %} + - +