Skip to main content

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'
  'external': 'http://google.com'

Note that the .html extension should be omitted (and will be automatically appended).

The plugin will dynamically create old.html, something/before.html, and external.html in your configured site_dir with HTML that will include a meta redirect to the new page location.

If the new location does not start with http or HTTP then it 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-redirects-0.0.6.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file mkdocs-redirects-0.0.6.tar.gz.

File metadata

  • Download URL: mkdocs-redirects-0.0.6.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.13

File hashes

Hashes for mkdocs-redirects-0.0.6.tar.gz
Algorithm Hash digest
SHA256 0de62365343b04afb0b4dcc96463b8f70b772e08ee7b0d72c640111aa4965f66
MD5 4d69e4701fbab972241afa13c819a945
BLAKE2b-256 0f0eba169458f97ff8a45bc06c589b803533014f5c2da540aeb3760d9f14dc16

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page