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:

```bash
pip install mkdocs-redirects
```

Enable the plugin in your `mkdocs.yml`:

```yaml
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


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.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: mkdocs-redirects-0.0.1.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

Hashes for mkdocs-redirects-0.0.1.tar.gz
Algorithm Hash digest
SHA256 03c710823b837d5598869053e3dae8c1ce954e4d82f6504e273b73213d628323
MD5 14e485d6080fdf0adfe59e8b5dfa49fd
BLAKE2b-256 ee76717947b0996e20f396c69d13e9ae3a77ef5bd04c24f8b923d7418a857662

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