Skip to main content

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


Download files

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

Source Distribution

sphinxcontrib_redirects-0.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

sphinxcontrib_redirects-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file sphinxcontrib_redirects-0.2.0.tar.gz.

File metadata

File hashes

Hashes for sphinxcontrib_redirects-0.2.0.tar.gz
Algorithm Hash digest
SHA256 51d407865c296a1b076a63f62be8a5e88ecf70a96cad6f8240814fdafd30c4b9
MD5 08dbf9057510ab80fc6646d7642376a0
BLAKE2b-256 4f357a00e96f18b4037e7d4e7678e612feda6e1670de9c0f510f13e81ff39fb2

See more details on using hashes here.

File details

Details for the file sphinxcontrib_redirects-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_redirects-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b831d29d9f58c97d3050a3e98d1cf56aa87a4e7bfded01fe83e1caf4c32cf5a
MD5 6db826af7587c52fde6f2c4577422cff
BLAKE2b-256 a4a804cd4501d5da44a4acf55d9a54d034b08953e42d7f2b1a38bd73057ced5d

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