diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index d2b27efe..1869144f 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -128,3 +128,24 @@ jobs: - name: image-check run: make -C docs/ imagecheck + + check-redirect: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Fetch origin/main + run: git fetch origin main --depth=1 + + - name: Python Setup + uses: actions/setup-python@v4 + with: + python-version: 3.9 + cache: 'pip' + + - name: Python Install Dependencies + run: pip install -r docs/requirements.txt + + - name: check-redirect + run: make -C docs/ rediraffecheckdiff diff --git a/docs/requirements.txt b/docs/requirements.txt index 4b065703..54c484bc 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -9,3 +9,5 @@ git+https://github.com/FIRST-Tech-Challenge/ftcdocs-helper@main#subdirectory=coo sphinx-sitemap==2.3.0 python-git-info==0.8.3 sphinxcontrib-mermaid==0.9.2 +sphinxext-linkcheckdiff==0.1.0 +sphinxext-rediraffe==0.2.7 diff --git a/docs/source/conf.py b/docs/source/conf.py index 55905247..f26d3cdf 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -29,6 +29,7 @@ 'sphinxcontrib.googleanalytics', 'sphinxcontrib.cookiebanner', 'sphinxcontrib.mermaid', + "sphinxext.rediraffe", ] autosectionlabel_prefix_document = True @@ -356,3 +357,6 @@ def setup(app): # Add support for translations gettext_compact = False locale_dirs = ["locale/"] + +rediraffe_redirects = "redirects.txt" +rediraffe_branch = "origin/main" diff --git a/docs/source/redirects.txt b/docs/source/redirects.txt new file mode 100644 index 00000000..e69de29b