1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 01:10:58 +01:00

Merge branch 'master' of git://github.com/kcgthb/mkdocs-material into kcgthb-master

This commit is contained in:
squidfunk 2018-12-28 15:01:21 +01:00
commit afd2787fea
2 changed files with 26 additions and 0 deletions

View File

@ -48,6 +48,21 @@ see on the current page when you scroll to the top. It's as simple as:
``` markdown ``` markdown
hero: Metadata enables hero teaser texts hero: Metadata enables hero teaser texts
``` ```
### Redirects
It's sometimes necessary to move documents around in the navigation tree and
redirect user from the old URL to the new one. The `redirect:` meta-tag allows
to create a redirection from the current document to the address specified in
the tag.
For instance, if your document contains:
``` markdown
redirect: /new/url
```
accessing that document's URL will automatically redirect to `/new/url`.
### Linking sources ### Linking sources

View File

@ -20,4 +20,15 @@
IN THE SOFTWARE. IN THE SOFTWARE.
--> -->
{% if page.meta.redirect %}
<script>
// redirect anchors
var anchor = window.location.hash.substr(1);
location.href = '{{ page.meta.redirect }}' + (anchor?'#'+anchor:'');
</script>
<!-- no-js fallback -->
<meta http-equiv="refresh" content="0; url={{ page.meta.redirect }}">
<link rel="canonical" href="{{ page.meta.redirect }}">
<meta name="robots" content="noindex">
{% endif %}
{% extends "base.html" %} {% extends "base.html" %}