2020-07-23 17:07:16 +03:00
|
|
|
---
|
|
|
|
template: overrides/main.html
|
|
|
|
---
|
|
|
|
|
|
|
|
# Deprecations
|
|
|
|
|
2020-07-23 18:00:20 +03:00
|
|
|
This page includes a list of deprecations, indicating which features of Material
|
|
|
|
for MkDocs were replaced with newer, more flexible alternatives, and thus should
|
|
|
|
not be used anymore.
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
## Front matter
|
|
|
|
|
2020-07-23 18:00:20 +03:00
|
|
|
### Redirect
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
:octicons-archive-24: Deprecated: 5.5.0 ·
|
2020-07-23 18:00:20 +03:00
|
|
|
:octicons-trash-24: Removal: 6.x
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
The `redirect` key, which could be added via [Metadata][1], allowed to
|
2020-07-23 18:00:20 +03:00
|
|
|
specify a redirect from within a document to a new address, which is a good
|
|
|
|
idea when moving content around:
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
``` markdown
|
|
|
|
---
|
|
|
|
redirect: /path/to/new/file
|
|
|
|
---
|
|
|
|
```
|
|
|
|
|
|
|
|
The [mkdocs-redirects][2] plugin provides the ability to define redirect
|
|
|
|
mappings via `mkdocs.yml`, which is considered to be a much better solution to
|
|
|
|
achieve the same result:
|
|
|
|
|
|
|
|
``` yaml
|
|
|
|
plugins:
|
|
|
|
- search
|
|
|
|
- redirects:
|
|
|
|
redirect_maps:
|
|
|
|
path/to/old/file.md: path/to/new/file.md
|
|
|
|
```
|
|
|
|
|
|
|
|
[1]: reference/meta-tags.md#metadata
|
|
|
|
[2]: https://github.com/datarobot/mkdocs-redirects
|
|
|
|
|
2020-07-23 18:00:20 +03:00
|
|
|
### Source link
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
:octicons-archive-24: Deprecated: 5.5.0 ·
|
2020-07-23 18:00:20 +03:00
|
|
|
:octicons-trash-24: Removal: 6.x
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
The `source` and `path` keys, which could be added via [Metadata][1], showed
|
2020-07-23 18:00:20 +03:00
|
|
|
a source icon at the top right corner of a document, linking a document to a
|
|
|
|
single source file:
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
``` markdown
|
|
|
|
---
|
|
|
|
path: tree/master/docs
|
|
|
|
source: deprecations.md
|
|
|
|
---
|
|
|
|
```
|
|
|
|
|
|
|
|
Only a single source file could be linked, which is useless if a document refers
|
|
|
|
to multiple files (or multiple sections within a single file). A more flexible
|
|
|
|
approach is to use the new [icon integration][3]:
|
|
|
|
|
|
|
|
``` markdown
|
|
|
|
[:octicons-file-code-24: Source](https://github.com/squidfunk/mkdocs-material/blob/master/docs/deprecations.md)
|
|
|
|
```
|
|
|
|
|
2020-07-23 18:00:20 +03:00
|
|
|
This will render as [:octicons-file-code-24: Source][4], which can be included
|
|
|
|
at arbitrary positions in any document.
|
2020-07-23 17:07:16 +03:00
|
|
|
|
|
|
|
[3]: setup/changing-the-logo-and-icons.md#icons
|
|
|
|
[4]: https://github.com/squidfunk/mkdocs-material/blob/master/docs/deprecations.md
|
2020-07-23 18:00:20 +03:00
|
|
|
|
|
|
|
### Hero
|
|
|
|
|
|
|
|
:octicons-archive-24: Deprecated: 5.5.0 ·
|
|
|
|
:octicons-trash-24: Removal: 6.x
|
|
|
|
|
|
|
|
The `hero` key, which could be added via [Metadata][1], allowed to render a
|
|
|
|
simple, text-only and page-local teaser text as part of a document. It could
|
|
|
|
be set from front matter with:
|
|
|
|
|
|
|
|
``` markdown
|
|
|
|
---
|
|
|
|
hero: Lorem ipsum dolor sit amet
|
|
|
|
---
|
|
|
|
```
|
|
|
|
|
|
|
|
The recommended way is to [override the `hero` block][5] via [theme
|
|
|
|
extension][6] for a specific page, which has the nice side effect that hero
|
|
|
|
templates can be shared among multiple pages:
|
|
|
|
|
|
|
|
=== "Markdown"
|
|
|
|
|
|
|
|
``` markdown
|
|
|
|
---
|
|
|
|
template: overrides/hero.html
|
|
|
|
---
|
|
|
|
```
|
|
|
|
|
|
|
|
=== "Template"
|
|
|
|
|
2020-07-27 15:44:47 +03:00
|
|
|
``` html
|
2020-07-23 18:00:20 +03:00
|
|
|
{% block hero %}
|
2020-07-27 15:44:47 +03:00
|
|
|
<!-- Add custom hero here -->
|
2020-07-23 18:00:20 +03:00
|
|
|
{% endblock %}
|
|
|
|
```
|
|
|
|
|
|
|
|
[5]: customization.md#overriding-blocks
|
|
|
|
[6]: customization.md#extending-the-theme
|