diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml new file mode 100644 index 000000000..b6dcfc282 --- /dev/null +++ b/.github/workflows/linkcheck.yml @@ -0,0 +1,18 @@ +name: Linkcheck +on: + schedule: + - cron: '0 6 * * 1' + pull_request: + paths: + - 'docs/**' + workflow_dispatch: {} + +jobs: + linkcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtcenter/metplus-action-linkcheck@v1 + with: + fail-on-broken-links: 'true' + upload-artifact: 'true' \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 291f08c30..e4146c7fe 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -262,6 +262,26 @@ 'figure': 'Figure %s', } +# -- linkcheck builder configuration ---------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder + +linkcheck_timeout = 10 +linkcheck_retries = 2 +linkcheck_workers = 8 + +linkcheck_ignore = [ + # add regex patterns for URLs that should be skipped, e.g.: + # r'https://dtcenter\.org/.*', # if this site blocks automated requests + # r'https://.*metexpress.*\.gsl\.noaa\.gov/.*', # live demo instance; may be internal-network-only +] + +linkcheck_allowed_redirects = { + # map of regex -> regex for redirects that are fine to follow +} + +linkcheck_anchors = True +linkcheck_anchors_ignore = ['^!'] + # -- Export variables -------------------------------------------------------- rst_epilog = """