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:
- 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.
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.2.tar.gz
.
File metadata
- Download URL: mkdocs-redirects-0.0.2.tar.gz
- Upload date:
- Size: 2.7 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.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 587ef0bd2064eccb4a5a8e961eec6b5173afe530a5482791847e7e4c4969d327 |
|
MD5 | 217ddac4f71eaeb32982b86d65fb115e |
|
BLAKE2b-256 | 9a547cb060d3d248215e176f982f864a0fefca65f5b3157003973f913edef965 |