A MkDocs plugin for dynamic page redirects to prevent broken links.
Project description
mkdocs-redirects
Open source plugin for Mkdocs page redirects
Installing
Note: This package requires MkDocs version 1.0.4 or higher.
Install with pip:
pip install mkdocs-redirects
Enable the plugin in your mkdocs.yml
:
plugins:
- search
- redirects
Using
In your mkdocs.yml
, add a redirects
block that maps the old page location to the new location:
redirects:
'old': 'some/new_location'
'something/before': 'another/moved/file'
Note that the .html
extension should be omitted (and will be automatically appended).
The plugin will dynamically create old.html
and something/before.html
in your configured site_dir
with
HTML that will include a meta redirect to the new page location.
The new location will also be appended with .html
extension and is assumed to be relative to the root of the site.
For nested subfolders, the plugin will automatically create these directories in the site_dir
.
Contributing
- Pull requests are welcome.
- File bugs and suggestions in the Github Issues tracker.
Releasing
make release
It will prompt you for your PyPI user and password.
See:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file mkdocs-redirects-0.0.3.tar.gz
.
File metadata
- Download URL: mkdocs-redirects-0.0.3.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6232483c52edb5d26bef1529e1cacdd999c7cff80654c02fbf8afe30ce83a92 |
|
MD5 | d5c097499c175d321e4ca62302d1d64b |
|
BLAKE2b-256 | c7a2b6f400ec2dc5d25cee62ef1dcf3d42134ddcf3fddd36f131e2c8009beb80 |