1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-27 17:00:54 +01:00

Prepare 7.0.0 release

This commit is contained in:
squidfunk 2021-02-22 23:05:09 +01:00
parent f27eb1ee07
commit 20f7440280
15 changed files with 408 additions and 102 deletions

View File

@ -1,3 +1,12 @@
mkdocs-material-7.0.0 (2021-02-22)
* Added support for deploying multiple versions
* Added support for integrating a language selector
* Added support for rendering admonitions as inline blocks
* Rewrite of the underlying reactive architecture
* Removed Webpack in favor of reactive build strategy (-480 dependencies)
* Fixed keyboard navigation for code blocks after content tabs switch
mkdocs-material-6.2.8 (2021-02-04) mkdocs-material-6.2.8 (2021-02-04)
* Updated Japanese and Polish translations * Updated Japanese and Polish translations

View File

@ -9,7 +9,7 @@ template: overrides/main.html
### 7.0.0 <small>_ February 22, 2021</small> ### 7.0.0 <small>_ February 22, 2021</small>
- Added support for deploying multiple versions - Added support for deploying multiple versions
- Added support for adding a language selector - Added support for integrating a language selector
- Added support for rendering admonitions as inline blocks - Added support for rendering admonitions as inline blocks
- Rewrite of the underlying reactive architecture - Rewrite of the underlying reactive architecture
- Removed Webpack in favor of reactive build strategy (-480 dependencies) - Removed Webpack in favor of reactive build strategy (-480 dependencies)

View File

@ -16,6 +16,311 @@ Inspect the currently installed version with:
pip show mkdocs-material pip show mkdocs-material
``` ```
## Upgrading from 6.x to 7.x
### What's new?
- Added support for deploying multiple versions
- Added support for integrating a language selector
- Added support for rendering admonitions as inline blocks
- Rewrite of the underlying reactive architecture
- Removed Webpack in favor of reactive build strategy (-480 dependencies)
- Fixed keyboard navigation for code blocks after content tabs switch
### Changes to `mkdocs.yml`
#### `extra.version.method`
The versioning method configuration was renamed to `extra.version.provider` to
allow for different versioning strategies in the future:
=== "7.x"
``` yaml
extra:
version:
provider: mike
```
=== "6.x"
``` yaml
extra:
version:
method: mike
```
### 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
@@ -61,7 +61,7 @@
font.text | replace(' ', '+') + ':300,400,400i,700%7C' +
font.code | replace(' ', '+')
}}&display=fallback">
- <style>body,input{font-family:"{{ font.text }}",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"{{ font.code }}",SFMono-Regular,Consolas,Menlo,monospace}</style>
+ <style>:root{--md-text-font-family:"{{ font.text }}";--md-code-font-family:"{{ font.code }}"}</style>
{% endif %}
{% endblock %}
{% if config.extra.manifest %}
@@ -131,7 +131,7 @@
{% if page and page.meta and page.meta.hide %}
{% set hidden = "hidden" if "navigation" in page.meta.hide %}
{% endif %}
- <div class="md-sidebar md-sidebar--primary" data-md-component="navigation" {{ hidden }}>
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" {{ hidden }}>
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/nav.html" %}
@@ -143,7 +143,7 @@
{% if page and page.meta and page.meta.hide %}
{% set hidden = "hidden" if "toc" in page.meta.hide %}
{% endif %}
- <div class="md-sidebar md-sidebar--secondary" data-md-component="toc" {{ hidden }}>
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" {{ hidden }}>
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/toc.html" %}
@@ -152,7 +152,7 @@
</div>
{% endif %}
{% endblock %}
- <div class="md-content">
+ <div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
{% block content %}
{% if page.edit_url %}
@@ -183,10 +183,18 @@
{% include "partials/footer.html" %}
{% endblock %}
</div>
- {% block scripts %}
- <script src="{{ 'assets/javascripts/vendor.18f0862e.min.js' | url }}"></script>
- <script src="{{ 'assets/javascripts/bundle.994580cf.min.js' | url }}"></script>
- {%- set translations = {} -%}
+ <div class="md-dialog" data-md-component="dialog">
+ <div class="md-dialog__inner md-typeset"></div>
+ </div>
+ {% block config %}
+ {%- set app = {
+ "base": base_url,
+ "features": features,
+ "translations": {},
+ "search": "assets/javascripts/workers/search.217ffd95.min.js" | url,
+ "version": config.extra.version or None
+ } -%}
+ {%- set translations = app.translations -%}
{%- for key in [
"clipboard.copy",
"clipboard.copied",
@@ -204,19 +212,12 @@
] -%}
{%- set _ = translations.update({ key: lang.t(key) }) -%}
{%- endfor -%}
- <script id="__lang" type="application/json">
- {{- translations | tojson -}}
- </script>
- {% block config %}{% endblock %}
- <script>
- app = initialize({
- base: "{{ base_url }}",
- features: {{ features or [] | tojson }},
- search: Object.assign({
- worker: "{{ 'assets/javascripts/worker/search.9c0e82ba.min.js' | url }}"
- }, typeof search !== "undefined" && search)
- })
+ <script id="__config" type="application/json">
+ {{- app | tojson -}}
</script>
+ {% endblock %}
+ {% block scripts %}
+ <script src="{{ 'assets/javascripts/bundle.926459b3.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}
```
??? quote "`partials/footer.html`"
``` diff
- <div class="md-footer-nav">
- <nav class="md-footer-nav__inner md-grid" aria-label="{{ lang.t('footer.title') }}">
- {% if page.previous_page %}
- <a href="{{ page.previous_page.url | url }}" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
- <div class="md-footer-nav__button md-icon">
- {% include ".icons/material/arrow-left.svg" %}
- </div>
- <div class="md-footer-nav__title">
- <div class="md-ellipsis">
- <span class="md-footer-nav__direction">
- {{ lang.t("footer.previous") }}
- </span>
- {{ page.previous_page.title }}
- </div>
- </div>
- </a>
- {% endif %}
- {% if page.next_page %}
- <a href="{{ page.next_page.url | url }}" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
- <div class="md-footer-nav__title">
- <div class="md-ellipsis">
- <span class="md-footer-nav__direction">
- {{ lang.t("footer.next") }}
- </span>
- {{ page.next_page.title }}
- </div>
+ <nav class="md-footer__inner md-grid" aria-label="{{ lang.t('footer.title') }}">
+ {% if page.previous_page %}
+ <a href="{{ page.previous_page.url | url }}" class="md-footer__link md-footer__link--prev" rel="prev">
+ <div class="md-footer__button md-icon">
+ {% include ".icons/material/arrow-left.svg" %}
+ </div>
+ <div class="md-footer__title">
+ <div class="md-ellipsis">
+ <span class="md-footer__direction">
+ {{ lang.t("footer.previous") }}
+ </span>
+ {{ page.previous_page.title }}
</div>
- <div class="md-footer-nav__button md-icon">
- {% include ".icons/material/arrow-right.svg" %}
+ </div>
+ </a>
+ {% endif %}
+ {% if page.next_page %}
+ <a href="{{ page.next_page.url | url }}" class="md-footer__link md-footer__link--next" rel="next">
+ <div class="md-footer__title">
+ <div class="md-ellipsis">
+ <span class="md-footer__direction">
+ {{ lang.t("footer.next") }}
+ </span>
+ {{ page.next_page.title }}
</div>
- </a>
- {% endif %}
- </nav>
- </div>
+ </div>
+ <div class="md-footer__button md-icon">
+ {% include ".icons/material/arrow-right.svg" %}
+ </div>
+ </a>
+ {% endif %}
+ </nav>
{% endif %}
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
```
??? quote "`partials/header.html`"
``` diff
@@ -6,21 +6,21 @@
{% set site_url = site_url ~ "/index.html" %}
{% endif %}
<header class="md-header" data-md-component="header">
- <nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">
- <a href="{{ site_url }}" title="{{ config.site_name | e }}" class="md-header-nav__button md-logo" aria-label="{{ config.site_name }}">
+ <nav class="md-header__inner md-grid" aria-label="{{ lang.t('header.title') }}">
+ <a href="{{ site_url }}" title="{{ config.site_name | e }}" class="md-header__button md-logo" aria-label="{{ config.site_name }}">
{% include "partials/logo.html" %}
</a>
- <label class="md-header-nav__button md-icon" for="__drawer">
+ <label class="md-header__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
</label>
- <div class="md-header-nav__title" data-md-component="header-title">
- <div class="md-header-nav__ellipsis">
- <div class="md-header-nav__topic">
+ <div class="md-header__title" data-md-component="header-title">
+ <div class="md-header__ellipsis">
+ <div class="md-header__topic">
<span class="md-ellipsis">
{{ config.site_name }}
</span>
</div>
- <div class="md-header-nav__topic">
+ <div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
{% if page and page.meta and page.meta.title %}
{{ page.meta.title }}
@@ -31,14 +31,35 @@
</div>
</div>
</div>
+ <div class="md-header__options">
+ {% if config.extra.alternate %}
+ <div class="md-select">
+ {% set icon = config.theme.icon.translate or "material/translate" %}
+ <span class="md-header__button md-icon">
+ {% include ".icons/" ~ icon ~ ".svg" %}
+ </span>
+ <div class="md-select__inner">
+ <ul class="md-select__list">
+ {% for alt in config.extra.alternate %}
+ <li class="md-select__item">
+ <a href="{{ alt.link | url }}" class="md-select__link">
+ {{ alt.name }}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+ </div>
{% if "search" in config["plugins"] %}
- <label class="md-header-nav__button md-icon" for="__search">
+ <label class="md-header__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
</label>
{% include "partials/search.html" %}
{% endif %}
{% if config.repo_url %}
- <div class="md-header-nav__source">
+ <div class="md-header__source">
{% include "partials/source.html" %}
</div>
{% endif %}
```
??? quote "`partials/source.html`"
``` diff
@@ -4,5 +4,5 @@
{% import "partials/language.html" as lang with context %}
-<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source">
+<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
{% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %}
{% include ".icons/" ~ icon ~ ".svg" %}
```
??? quote "`partials/toc.html`"
``` diff
@@ -12,7 +12,7 @@
<span class="md-nav__icon md-icon"></span>
{{ lang.t("toc.title") }}
</label>
- <ul class="md-nav__list" data-md-scrollfix>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
{% for toc_item in toc %}
{% include "partials/toc-item.html" %}
{% endfor %}
```
## Upgrading from 5.x to 6.x ## Upgrading from 5.x to 6.x
### What's new? ### What's new?

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@
<link rel="canonical" href="{{ page.canonical_url }}"> <link rel="canonical" href="{{ page.canonical_url }}">
{% endif %} {% endif %}
<link rel="shortcut icon" href="{{ config.theme.favicon | url }}"> <link rel="shortcut icon" href="{{ config.theme.favicon | url }}">
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-7.0.0b2"> <meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-7.0.0">
{% endblock %} {% endblock %}
{% block htmltitle %} {% block htmltitle %}
{% if page and page.meta and page.meta.title %} {% if page and page.meta and page.meta.title %}
@ -39,7 +39,7 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.3149646c.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/main.a3f8f96a.min.css' | url }}">
{% if config.theme.palette %} {% if config.theme.palette %}
{% set palette = config.theme.palette %} {% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.7fa14f5b.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/palette.7fa14f5b.min.css' | url }}">

View File

@ -4,40 +4,38 @@
{% import "partials/language.html" as lang with context %} {% import "partials/language.html" as lang with context %}
<footer class="md-footer"> <footer class="md-footer">
{% if page.previous_page or page.next_page %} {% if page.previous_page or page.next_page %}
<div class="md-footer-nav"> <nav class="md-footer__inner md-grid" aria-label="{{ lang.t('footer.title') }}">
<nav class="md-footer-nav__inner md-grid" aria-label="{{ lang.t('footer.title') }}"> {% if page.previous_page %}
{% if page.previous_page %} <a href="{{ page.previous_page.url | url }}" class="md-footer__link md-footer__link--prev" rel="prev">
<a href="{{ page.previous_page.url | url }}" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-footer__button md-icon">
<div class="md-footer-nav__button md-icon"> {% include ".icons/material/arrow-left.svg" %}
{% include ".icons/material/arrow-left.svg" %} </div>
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
{{ lang.t("footer.previous") }}
</span>
{{ page.previous_page.title }}
</div> </div>
<div class="md-footer-nav__title"> </div>
<div class="md-ellipsis"> </a>
<span class="md-footer-nav__direction"> {% endif %}
{{ lang.t("footer.previous") }} {% if page.next_page %}
</span> <a href="{{ page.next_page.url | url }}" class="md-footer__link md-footer__link--next" rel="next">
{{ page.previous_page.title }} <div class="md-footer__title">
</div> <div class="md-ellipsis">
<span class="md-footer__direction">
{{ lang.t("footer.next") }}
</span>
{{ page.next_page.title }}
</div> </div>
</a> </div>
{% endif %} <div class="md-footer__button md-icon">
{% if page.next_page %} {% include ".icons/material/arrow-right.svg" %}
<a href="{{ page.next_page.url | url }}" class="md-footer-nav__link md-footer-nav__link--next" rel="next"> </div>
<div class="md-footer-nav__title"> </a>
<div class="md-ellipsis"> {% endif %}
<span class="md-footer-nav__direction"> </nav>
{{ lang.t("footer.next") }}
</span>
{{ page.next_page.title }}
</div>
</div>
<div class="md-footer-nav__button md-icon">
{% include ".icons/material/arrow-right.svg" %}
</div>
</a>
{% endif %}
</nav>
</div>
{% endif %} {% endif %}
<div class="md-footer-meta md-typeset"> <div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid"> <div class="md-footer-meta__inner md-grid">

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "mkdocs-material", "name": "mkdocs-material",
"version": "7.0.0b2", "version": "7.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "mkdocs-material", "name": "mkdocs-material",
"version": "7.0.0b2", "version": "7.0.0",
"description": "A Material Design theme for MkDocs", "description": "A Material Design theme for MkDocs",
"keywords": [ "keywords": [
"mkdocs", "mkdocs",

View File

@ -33,12 +33,8 @@
@media print { @media print {
display: none; display: none;
} }
}
// Footer navigation // Footer wrapper
.md-footer-nav {
// Footer navigation wrapper
&__inner { &__inner {
padding: px2rem(4px); padding: px2rem(4px);
overflow: auto; overflow: auto;
@ -70,8 +66,8 @@
@include break-to-device(mobile) { @include break-to-device(mobile) {
width: 25%; width: 25%;
// Hide footer navigation title // Hide footer title
.md-footer-nav__title { .md-footer__title {
display: none; display: none;
} }
} }
@ -110,7 +106,7 @@
} }
} }
// Footer navigation title // Footer title
&__title { &__title {
position: relative; position: relative;
flex-grow: 1; flex-grow: 1;
@ -120,13 +116,13 @@
line-height: px2rem(48px); line-height: px2rem(48px);
} }
// Footer navigation link button // Footer link button
&__button { &__button {
margin: px2rem(4px); margin: px2rem(4px);
padding: px2rem(8px); padding: px2rem(8px);
} }
// Footer navigation link direction (i.e. prev and next) // Footer link direction (i.e. prev and next)
&__direction { &__direction {
position: absolute; position: absolute;
right: 0; right: 0;
@ -162,7 +158,7 @@
} }
} }
// Footer copyright metadata // Footer copyright and theme information
.md-footer-copyright { .md-footer-copyright {
width: 100%; width: 100%;
margin: auto px2rem(12px); margin: auto px2rem(12px);
@ -182,7 +178,7 @@
} }
} }
// Footer social metadata // Footer social links
.md-footer-social { .md-footer-social {
margin: 0 px2rem(8px); margin: 0 px2rem(8px);
padding: px2rem(4px) 0 px2rem(12px); padding: px2rem(4px) 0 px2rem(12px);

View File

@ -227,7 +227,7 @@
{% endif %} {% endif %}
</div> </div>
<!-- Application header --> <!-- Header -->
{% block header %} {% block header %}
{% include "partials/header.html" %} {% include "partials/header.html" %}
{% endblock %} {% endblock %}
@ -338,7 +338,7 @@
</div> </div>
</main> </main>
<!-- Application footer --> <!-- Footer -->
{% block footer %} {% block footer %}
{% include "partials/footer.html" %} {% include "partials/footer.html" %}
{% endblock %} {% endblock %}

View File

@ -1,5 +1,5 @@
<!-- <!--
Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com> Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to of this software and associated documentation files (the "Software"), to
@ -22,60 +22,58 @@
{% import "partials/language.html" as lang with context %} {% import "partials/language.html" as lang with context %}
<!-- Application footer --> <!-- Footer -->
<footer class="md-footer"> <footer class="md-footer">
<!-- Link to previous and/or next page --> <!-- Link to previous and/or next page -->
{% if page.previous_page or page.next_page %} {% if page.previous_page or page.next_page %}
<div class="md-footer-nav"> <nav
<nav class="md-footer__inner md-grid"
class="md-footer-nav__inner md-grid" aria-label="{{ lang.t('footer.title') }}"
aria-label="{{ lang.t('footer.title') }}" >
>
<!-- Link to previous page --> <!-- Link to previous page -->
{% if page.previous_page %} {% if page.previous_page %}
<a <a
href="{{ page.previous_page.url | url }}" href="{{ page.previous_page.url | url }}"
class="md-footer-nav__link md-footer-nav__link--prev" class="md-footer__link md-footer__link--prev"
rel="prev" rel="prev"
> >
<div class="md-footer-nav__button md-icon"> <div class="md-footer__button md-icon">
{% include ".icons/material/arrow-left.svg" %} {% include ".icons/material/arrow-left.svg" %}
</div>
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
{{ lang.t("footer.previous") }}
</span>
{{ page.previous_page.title }}
</div> </div>
<div class="md-footer-nav__title"> </div>
<div class="md-ellipsis"> </a>
<span class="md-footer-nav__direction"> {% endif %}
{{ lang.t("footer.previous") }}
</span>
{{ page.previous_page.title }}
</div>
</div>
</a>
{% endif %}
<!-- Link to next page --> <!-- Link to next page -->
{% if page.next_page %} {% if page.next_page %}
<a <a
href="{{ page.next_page.url | url }}" href="{{ page.next_page.url | url }}"
class="md-footer-nav__link md-footer-nav__link--next" class="md-footer__link md-footer__link--next"
rel="next" rel="next"
> >
<div class="md-footer-nav__title"> <div class="md-footer__title">
<div class="md-ellipsis"> <div class="md-ellipsis">
<span class="md-footer-nav__direction"> <span class="md-footer__direction">
{{ lang.t("footer.next") }} {{ lang.t("footer.next") }}
</span> </span>
{{ page.next_page.title }} {{ page.next_page.title }}
</div>
</div> </div>
<div class="md-footer-nav__button md-icon"> </div>
{% include ".icons/material/arrow-right.svg" %} <div class="md-footer__button md-icon">
</div> {% include ".icons/material/arrow-right.svg" %}
</a> </div>
{% endif %} </a>
</nav> {% endif %}
</div> </nav>
{% endif %} {% endif %}
<!-- Further information --> <!-- Further information -->

View File

@ -26,7 +26,7 @@
{% set site_url = site_url ~ "/index.html" %} {% set site_url = site_url ~ "/index.html" %}
{% endif %} {% endif %}
<!-- Application header --> <!-- Header -->
<header class="md-header" data-md-component="header"> <header class="md-header" data-md-component="header">
<nav <nav
class="md-header__inner md-grid" class="md-header__inner md-grid"