Sphinx extension to generate JavaScript-driven redirects for moved pages
Project description
This contrib extension, sphinxcontrib.redirects, provides a Sphinx extension for generating JavaScript-driven redirects for moved pages. It currently only supports the html builder (sphinx.builders.html.SingleFileHTMLBuilder).
Usage
To enable the extension, you should add it to your conf.py file:
extensions = [ 'sphinxcontrib.redirects', ... ]
The extension relies on a redirect file. This defaults to redirects within the source directory but it can be overridden. To override this value, add the following to your conf.py file:
redirects_file = '<path to redirects file>'
The redirect file is a simple space-separated file of old_path - new_path pairs. These paths are relative to the source directory and should include their extension. For example, if you renamed the file test.rst to testing.rst then you could write:
test.rst testing.rst
This works for files moved between directories too. If you moved a test.rst to testing/index.rst instead, then you could write:
test.rst testing/index.rst
For examples, refer to the samples used in the tests.
Contributing
For information on contributing, refer to the contributing guide.
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
Built Distribution
Hashes for sphinxcontrib-redirects-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc225dfb98874b253d4b7eac0adc8203ed331c19315fd225a07740f1a36a9c8 |
|
MD5 | 3cb37976d4add98e675e9e32b253e6fa |
|
BLAKE2b-256 | aa12281762c8ca95102118d7f528229cfdc1fed5892a7de31135c57e7fc6b42c |
Hashes for sphinxcontrib_redirects-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f277857b904894c926894d51fcebbbb511c7e128165587a36bb16354932408 |
|
MD5 | 6b01c00ecf0572f476885124a04a9193 |
|
BLAKE2b-256 | 62b3f4f964f91f0329e4eee56026fc0961f3178816f0f6ff1b8deca5063e1324 |