mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-23 23:21:00 +01:00
Merge branch 'master' of git://github.com/kcgthb/mkdocs-material into kcgthb-master
This commit is contained in:
commit
afd2787fea
@ -48,6 +48,21 @@ see on the current page when you scroll to the top. It's as simple as:
|
||||
``` markdown
|
||||
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
|
||||
|
||||
|
@ -20,4 +20,15 @@
|
||||
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" %}
|
||||
|
Loading…
Reference in New Issue
Block a user