https://github.com/sphinx-contrib/redirects
A Sphinx extension for generating JavaScript-driven redirects for moved pages
https://github.com/sphinx-contrib/redirects
Last synced: 7 days ago
JSON representation
A Sphinx extension for generating JavaScript-driven redirects for moved pages
- Host: GitHub
- URL: https://github.com/sphinx-contrib/redirects
- Owner: sphinx-contrib
- License: bsd-2-clause
- Created: 2017-09-27T21:05:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-08T17:07:44.000Z (7 months ago)
- Last Synced: 2025-04-21T08:04:11.604Z (19 days ago)
- Language: Python
- Size: 18.6 KB
- Stars: 9
- Watchers: 1
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=======================
sphinxcontrib-redirects
=======================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``)... note::
The `sphinxext-rediraffe `__
extension appears to provide many more features than this package and
should probably be preferred for new projects.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 = ''
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
`__.