diff --git a/.github/workflows/photonvision-docs.yml b/.github/workflows/photonvision-docs.yml index 16c9faac1..fd520c10b 100644 --- a/.github/workflows/photonvision-docs.yml +++ b/.github/workflows/photonvision-docs.yml @@ -12,6 +12,9 @@ on: - 'docs/**' - '.github/**' +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + jobs: build: runs-on: ubuntu-22.04 diff --git a/docs/source/conf.py b/docs/source/conf.py index b7b45f42f..8de2d4414 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,7 +10,8 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os +import os + # import sys # sys.path.insert(0, os.path.abspath('.')) @@ -138,9 +139,15 @@ suppress_warnings = ["epub.unknown_project_files"] sphinx_tabs_valid_builders = ["epub", "linkcheck"] +# -- Options for linkcheck ------------------------------------------------- + # Excluded links for linkcheck # These should be periodically checked by hand to ensure that they are still functional -linkcheck_ignore = ["https://www.raspberrypi.com/software/"] +linkcheck_ignore = [R"https://www.raspberrypi.com/software/", R"http://10\..+"] + +token = os.environ.get("GITHUB_TOKEN", None) +if token: + linkcheck_auth = [(R"https://github.com/.+", token)] # MyST configuration (https://myst-parser.readthedocs.io/en/latest/configuration.html) myst_enable_extensions = ["colon_fence"]