MkDocs Redirects Plugin

1.2.3 · active · verified Sat Apr 11

mkdocs-redirects is a plugin for MkDocs that provides dynamic page redirects, crucial for maintaining link integrity when restructuring documentation. As of version 1.2.3, it offers robust mapping capabilities for internal and external links. The project is under active development, with a recent transition to a new organizational umbrella, ProperDocs, signaling continued evolution.

Warnings

Install

Imports

Quickstart

To enable `mkdocs-redirects`, add it to the `plugins` section of your `mkdocs.yml` file. Define redirect mappings using `redirect_maps`, where keys are old paths (relative to `docs_dir`) and values are new paths (can be internal relative, absolute, or external URLs).

# mkdocs.yml
site_name: My Awesome Docs

plugins:
  - redirects:
      redirect_maps:
        'old-page.md': 'new-page.md'
        'blog/legacy-post.md': '/blog/current-post/' # Absolute path within site
        'external-link.md': 'https://example.com/new-resource'
        'docs/old-section/chapter-1.md': '../new-section/chapter-1.md' # Relative to docs_dir

view raw JSON →