Skip to content

feat(docs): add stable links for external sites #9620

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

Merged
merged 4 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion docs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def check_link(url) -> bool:

while attempts > 0:
response = requests.head(url, timeout=5000)
if response.status_code == 200:
# Ensure GH is not causing issues
if response.status_code in (200, 429):
# Update the cache file
with open(CACHE_FILE, 'a', encoding='utf-8') as f:
f.write(f'{url}\n')
Expand Down
16 changes: 16 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,22 @@ plugins:
show_symbol_type_toc: true
show_root_heading: false
show_root_toc_entry: false
- redirects:
redirect_maps:
'sref/contrib.md': 'develop/contributing.md' # https://github.com/inventree/InvenTree/blob/master/CONTRIBUTING.md.
'sref/docs.md': 'index.md' # https://docs.inventree.org/en/latest/
'sref/api.md': 'api/index.md' # https://demo.inventree.org/api-doc/
'sref/code.md': 'https://github.com/inventree/InvenTree/tree/master' # https://github.com/inventree/InvenTree/tree/master
'sref/oci-image.md': 'https://hub.docker.com/r/inventree/inventree/tags' # https://hub.docker.com/r/inventree/inventree/tags
'sref/releases.md': 'https://github.com/inventree/InvenTree/releases' # https://github.com/inventree/InvenTree/releases
'sref/issues.md': 'https://github.com/inventree/InvenTree/issues' # https://github.com/inventree/InvenTree/issues
'sref/security-policy.md': 'https://github.com/inventree/InvenTree/security/policy' # https://github.com/inventree/InvenTree/security/policy
'sref/security-history.md': 'https://huntr.dev/repos/inventree/inventree/' # https://huntr.dev/repos/inventree/inventree/
'sref/ci.md': 'https://github.com/inventree/InvenTree/actions' # https://github.com/inventree/InvenTree/actions
'sref/ci-sample.md': 'https://github.com/inventree/InvenTree/blob/master/.github/workflows/qc_checks.yaml' # https://github.com/inventree/InvenTree/blob/master/.github/workflows/qc_checks.yaml
'sref/ci-pre.md': 'https://github.com/inventree/InvenTree/blob/master/.pre-commit-config.yaml' # https://github.com/inventree/InvenTree/blob/master/.pre-commit-config.yaml
'sref/test-sample.md': 'https://github.com/inventree/InvenTree/blob/master/src/backend/InvenTree/InvenTree/tests.py' # https://github.com/inventree/InvenTree/blob/master/src/backend/InvenTree/InvenTree/tests.py
'sref/coverage.md': 'https://coveralls.io/github/inventree/InvenTree' # https://coveralls.io/github/inventree/InvenTree

# Extensions
markdown_extensions:
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mkdocs==1.6.1
mkdocs-macros-plugin>=0.7,<2.0
mkdocs-material>=9.0,<10.0
mkdocs-git-revision-date-localized-plugin>=1.1,<2.0
mkdocs-redirects
mkdocs-simple-hooks>=0.1,<1.0
mkdocs-include-markdown-plugin
neoteroi-mkdocs
Expand Down
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ mkdocs==1.6.1 \
# mkdocs-include-markdown-plugin
# mkdocs-macros-plugin
# mkdocs-material
# mkdocs-redirects
# mkdocs-simple-hooks
# mkdocstrings
# neoteroi-mkdocs
Expand Down Expand Up @@ -339,6 +340,10 @@ mkdocs-material-extensions==1.3.1 \
--hash=sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443 \
--hash=sha256:adff8b62700b25cb77b53358dad940f3ef973dd6db797907c49e3c2ef3ab4e31
# via mkdocs-material
mkdocs-redirects==1.2.2 \
--hash=sha256:3094981b42ffab29313c2c1b8ac3969861109f58b2dd58c45fc81cd44bfa0095 \
--hash=sha256:7dbfa5647b79a3589da4401403d69494bd1f4ad03b9c15136720367e1f340ed5
# via -r docs/requirements.in
mkdocs-simple-hooks==0.1.5 \
--hash=sha256:dddbdf151a18723c9302a133e5cf79538be8eb9d274e8e07d2ac3ac34890837c \
--hash=sha256:efeabdbb98b0850a909adee285f3404535117159d5cb3a34f541d6eaa644d50a
Expand Down
Loading