Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rediraffe support #90

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion contributing/submit-contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,26 @@ You can run:
make linkcheck

To perform a full spelling and link check. You can also run ``make`` by itself
to see a list of all the possible ``make`` targets.
to see a list of all the possible ``make`` targets.

Check if you need redirects
===========================

If you rename, move or delete an existing file, a corresponding redirect must
be created to ensure users don't run into 404 errors in the published
s-makin marked this conversation as resolved.
Show resolved Hide resolved
documentation.

To set up a redirect, add a line to the end of the `redirects.txt` file in the
root directory, in the following format:

```
redirect/path/from/ redirect/path/to/
```

Note that there should be no preceding foward slash at the start of the path,
but there must be a trailing one at the end. See the
`Sphinx Rediraffe docs <https://sphinxext-rediraffe.readthedocs.io/en/latest/>`_
for more guidance, or reach out to us for help.

Manual testing
==============
Expand Down
6 changes: 6 additions & 0 deletions custom_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
'myst_parser',
'sphinxcontrib.jquery',
'sphinxcontrib.mermaid',
'sphinxext.rediraffe',
# 'canonical.youtube-links',
# 'canonical.related-links',
# 'canonical.custom-rst-roles',
Expand All @@ -183,8 +184,13 @@
# sphinxext-opengraph
custom_required_modules = [
'sphinxcontrib-mermaid',
'sphinxext-rediraffe',
]

# Add redirects, so they can be updated here to land with docs being moved
rediraffe_branch = "main"
rediraffe_redirects = "redirects.txt"

# Add files or directories that should be excluded from processing.
custom_excludes = [
'cheatsheets/',
Expand Down
9 changes: 9 additions & 0 deletions redirects.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Comment lines start with a hash (#) and are ignored
# Each redirect should appear on its own line
# Do not include a file extension
# Paths don't need a slash in front of them
# We are using the dirhtml builder so we need a trailing slash at the end
# The paths should match what's in the build directory
# Example:
# redirect/from redirect/to
bryceharrington marked this conversation as resolved.
Show resolved Hide resolved