Skip to content

Switch to sphinx-reredirects extension #447

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions docs/_modules/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

def source_redirects_glob_in_custom_format(file_paths_glob):
"""
Sources redirects from a filepath glob (such as "_redirects/*.txt"). This enables splitting the redirects into multiple files. Also, it uses custom format for redirects which is slightly different from the rediraffe format. It doesn't require quote marks and it supports comments by starting the line with a '# '.
Sources redirects from a filepath glob (such as "_redirects/*.txt"). This enables splitting the redirects into multiple files. Also, it uses custom format for redirects which is slightly different from the sphinx-reredirects format. It supports leading and trailing slashes in URLs and supports comments by starting the line with a '# '.
"""
comment_syntax = r"# .*"
redirect_syntax = r"\"?([^\"\s]*)\"?\s*\"?([^\"\s]*)\"?"
redirect_syntax = r"/?([^\s]*)/?\s*([^\s]*)"
redirects = {}
for file_path in glob.glob(file_paths_glob):
with open(file_path, "r") as file:
Expand All @@ -16,3 +16,4 @@ def source_redirects_glob_in_custom_format(file_paths_glob):
if from_file and to_file:
redirects[from_file] = to_file
return redirects

550 changes: 275 additions & 275 deletions docs/_redirects/cmi-data-products.txt

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/_redirects/cmi-pages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# Redirects from miscellaneous pages on the old CMI site to the new Knowledge Hub.

node index
404 404-not-found
search/user search
search/node search
about index
resources guides
references-articles guides
references-articles-two guides
data-products data
data-products/dea data
/node/ /
/404/ /404-not-found/
/search/user/ /search/
/search/node/ /search/
/about/ /
/resources/ /guides/
/references-articles/ /guides/
/references-articles-two/ /guides/
/data-products/ /data/
/data-products/dea/ /data/
16 changes: 8 additions & 8 deletions docs/_redirects/cmi-themes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

# Redirects from the theme pages on the old CMI site to the new Knowledge Hub.

theme/baseline-satellite-data data/theme/baseline-satellite-data
theme/land-and-vegetation data/theme/land-and-vegetation
theme/inland-water data/theme/inland-water
theme/sea-ocean-and-coast data/theme/sea-ocean-and-coast
theme/hazards data/theme/hazards
/theme/baseline-satellite-data/ /data/theme/baseline-satellite-data/
/theme/land-and-vegetation/ /data/theme/land-and-vegetation/
/theme/inland-water/ /data/theme/inland-water/
/theme/sea-ocean-and-coast/ /data/theme/sea-ocean-and-coast/
/theme/hazards/ /data/theme/hazards/

theme/land-and-coastline data/theme/land-and-vegetation
theme/sea-ocean-and-coastline data/theme/sea-ocean-and-coast
theme/inland-waterbodies data/theme/inland-water
/theme/land-and-coastline/ /data/theme/land-and-vegetation/
/theme/sea-ocean-and-coastline/ /data/theme/sea-ocean-and-coast/
/theme/inland-waterbodies/ /data/theme/inland-water/
274 changes: 137 additions & 137 deletions docs/_redirects/cmi-version-history.txt

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/_redirects/data-products.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# Pages have been moved to a new URL.

data/product/dea-surface-reflectance-oa-landsat-9 data/product/dea-surface-reflectance-oa-landsat-9-oli-tirs
data/product/dea-surface-reflectance-landsat-9 data/product/dea-surface-reflectance-landsat-9-oli-tirs
data/product/dea-surface-reflectance-nbart-landsat-9 data/product/dea-surface-reflectance-nbart-landsat-9-oli-tirs
data/product/dea-surface-reflectance-nbar-landsat-9 data/product/dea-surface-reflectance-nbar-landsat-9-oli-tirs
data/product/dea-mangrove-canopy-cover-landsat data/product/dea-mangroves
/data/product/dea-surface-reflectance-oa-landsat-9/ /data/product/dea-surface-reflectance-oa-landsat-9-oli-tirs/
/data/product/dea-surface-reflectance-landsat-9/ /data/product/dea-surface-reflectance-landsat-9-oli-tirs/
/data/product/dea-surface-reflectance-nbart-landsat-9/ /data/product/dea-surface-reflectance-nbart-landsat-9-oli-tirs/
/data/product/dea-surface-reflectance-nbar-landsat-9/ /data/product/dea-surface-reflectance-nbar-landsat-9-oli-tirs/
/data/product/dea-mangrove-canopy-cover-landsat/ /data/product/dea-mangroves/

# An old URL found on DEA Maps

data/product/dea-water-observations-provisional-sentinel-2-nrt data/product/dea-water-observations-sentinel-2-nrt
/data/product/dea-water-observations-provisional-sentinel-2-nrt/ /data/product/dea-water-observations-sentinel-2-nrt/

72 changes: 36 additions & 36 deletions docs/_redirects/dea-docs-user-guides.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@

# Redirects from locations on the old DEA Docs site to the new Knowledge Hub.

about/changelog tech-alerts
about/faq guides/about/faq
about/glossary guides/about/glossary
about/intro guides/about/intro
about/publications guides/about/publications
about/citations guides/about/publications
guides/about/changelog tech-alerts
/about/changelog/ /tech-alerts/
/about/faq/ /guides/about/faq/
/about/glossary/ /guides/about/glossary/
/about/intro/ /guides/about/intro/
/about/publications/ /guides/about/publications/
/about/citations/ /guides/about/publications/
/guides/about/changelog/ /tech-alerts/

setup/AWS/data_and_metadata guides/setup/AWS/data_and_metadata
setup/dea_maps guides/setup/dea_maps
setup/explorer_guide guides/setup/explorer_guide
setup/gis/README guides/setup/gis/README
setup/gis/stac guides/setup/gis/stac
setup/gis/web_services guides/setup/gis/web_services
setup/jupyter guides/setup/jupyter
setup/NCI/account guides/setup/NCI/account
setup/NCI/advanced guides/setup/NCI/advanced
setup/NCI/basics guides/setup/NCI/basics
setup/NCI/README guides/setup/NCI/README
setup/README guides/setup/README
setup/Sandbox/sandbox guides/setup/Sandbox/sandbox
references-articles/analysis-ready-data-open-data-cube guides/reference/analysis-ready-data-example-queries
/setup/AWS/data_and_metadata/ /guides/setup/AWS/data_and_metadata/
/setup/dea_maps/ /guides/setup/dea_maps/
/setup/explorer_guide/ /guides/setup/explorer_guide/
/setup/gis/README/ /guides/setup/gis/README/
/setup/gis/stac/ /guides/setup/gis/stac/
/setup/gis/web_services/ /guides/setup/gis/web_services/
/setup/jupyter/ /guides/setup/jupyter/
/setup/NCI/account/ /guides/setup/NCI/account/
/setup/NCI/advanced/ /guides/setup/NCI/advanced/
/setup/NCI/basics/ /guides/setup/NCI/basics/
/setup/NCI/README/ /guides/setup/NCI/README/
/setup/README/ /guides/setup/README/
/setup/Sandbox/sandbox/ /guides/setup/Sandbox/sandbox/
/references-articles/analysis-ready-data-open-data-cube/ /guides/reference/analysis-ready-data-example-queries/

resources/glossary guides/about/glossary
reference/collection_3_naming guides/reference/collection_3_naming
resources/naming-convention guides/reference/collection_3_naming
reference-articles/data-product-naming-convention guides/reference/collection_3_naming
resources/data-product-naming-convention guides/reference/collection_3_naming
references-articles/open-data-cube-naming-conventions guides/reference/collection_3_naming
reference/collection_3_summary_grid guides/reference/collection_3_summary_grid
reference/dataset_maturity_guide guides/reference/dataset_maturity_guide
references-articles/analysis-ready-data-example-queries guides/reference/analysis-ready-data-example-queries
resources/analysis-ready-data-example-queries guides/reference/analysis-ready-data-example-queries
references-articles/open-data-cube-example guides/reference/analysis-ready-data-example-queries
references-articles/open-data-cube-example-queries guides/reference/analysis-ready-data-example-queries
# resources/how-to-access-data-on-the-CMI guides/setup/how-to-access-data-on-the-CMI
# references-articles/understanding-the-data-product-page guides/setup/how-to-access-data-on-the-CMI
# reference-articles/understanding-the-data-product-page guides/setup/how-to-access-data-on-the-CMI
/resources/glossary/ /guides/about/glossary/
/reference/collection_3_naming/ /guides/reference/collection_3_naming/
/resources/naming-convention/ /guides/reference/collection_3_naming/
/reference-articles/data-product-naming-convention/ /guides/reference/collection_3_naming/
/resources/data-product-naming-convention/ /guides/reference/collection_3_naming/
/references-articles/open-data-cube-naming-conventions/ /guides/reference/collection_3_naming/
/reference/collection_3_summary_grid/ /guides/reference/collection_3_summary_grid/
/reference/dataset_maturity_guide/ /guides/reference/dataset_maturity_guide/
/references-articles/analysis-ready-data-example-queries/ /guides/reference/analysis-ready-data-example-queries/
/resources/analysis-ready-data-example-queries/ /guides/reference/analysis-ready-data-example-queries/
/references-articles/open-data-cube-example/ /guides/reference/analysis-ready-data-example-queries/
/references-articles/open-data-cube-example-queries/ /guides/reference/analysis-ready-data-example-queries/
# /resources/how-to-access-data-on-the-CMI/ /guides/setup/how-to-access-data-on-the-CMI/
# /references-articles/understanding-the-data-product-page/ /guides/setup/how-to-access-data-on-the-CMI/
# /reference-articles/understanding-the-data-product-page/ /guides/setup/how-to-access-data-on-the-CMI/
4 changes: 2 additions & 2 deletions docs/_redirects/external-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Pages have moved to a new URL.

data/external-data/ga-ausbathytopo data/external-data/ga-ausbathytopo-250m
data/external-data/ga-srtm data/external-data/ga-srtm-1-second-dem
/data/external-data/ga-ausbathytopo/ /data/external-data/ga-ausbathytopo-250m/
/data/external-data/ga-srtm/ /data/external-data/ga-srtm-1-second-dem/
14 changes: 7 additions & 7 deletions docs/_redirects/notebooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

# The new DEA Notebooks cover page is on a different URL.

notebooks dea-notebooks
/notebooks/ /dea-notebooks/

# Notebooks category URLs automatically redirect to the README page for the category.

notebooks/Beginners_guide notebooks/Beginners_guide/README
notebooks/DEA_products notebooks/DEA_products/README
notebooks/How_to_guides notebooks/How_to_guides/README
notebooks/Interactive_apps notebooks/Interactive_apps/README
notebooks/Real_world_examples notebooks/Real_world_examples/README
/notebooks/Beginners_guide/ /notebooks/Beginners_guide/README/
/notebooks/DEA_products/ /notebooks/DEA_products/README/
/notebooks/How_to_guides/ /notebooks/How_to_guides/README/
/notebooks/Interactive_apps/ /notebooks/Interactive_apps/README/
/notebooks/Real_world_examples/ /notebooks/Real_world_examples/README/

# The DEA Sandbox landing page was removed from this site.

notebooks/DEA_Sandbox dea-notebooks
/notebooks/DEA_Sandbox/ /dea-notebooks/
2 changes: 1 addition & 1 deletion docs/_redirects/permalinks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# A permalink is a link that is not likely to change. It should be based on a constant value, such as a product's eCat number (e.g. 'permalink/146090').

# permalink/146090 data/product/dea-land-cover-landsat
# /permalink/146090/ /data/product/dea-land-cover-landsat/
14 changes: 7 additions & 7 deletions docs/_redirects/tech-alerts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ guides/tech_alerts_changelog tech-alerts

# The path was changed from 'tech-alerts-changelog' to 'tech-alerts' and the 'previous-years' path structure was changed

tech-alerts-changelog tech-alerts
tech-alerts-changelog/previous-years tech-alerts/previous-years
tech-alerts-changelog/previous-years/2023 tech-alerts/2023
tech-alerts-changelog/previous-years/2021 tech-alerts/2021
tech-alerts-changelog/previous-years/2020 tech-alerts/2020
tech-alerts-changelog/previous-years/2019 tech-alerts/2019
tech-alerts-changelog/previous-years/2018 tech-alerts/2018
/tech-alerts-changelog/ /tech-alerts/
/tech-alerts-changelog/previous-years/ /tech-alerts/previous-years/
/tech-alerts-changelog/previous-years/2023/ /tech-alerts/2023/
/tech-alerts-changelog/previous-years/2021/ /tech-alerts/2021/
/tech-alerts-changelog/previous-years/2020/ /tech-alerts/2020/
/tech-alerts-changelog/previous-years/2019/ /tech-alerts/2019/
/tech-alerts-changelog/previous-years/2018/ /tech-alerts/2018/
2 changes: 1 addition & 1 deletion docs/_redirects/user-guides.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# User guides whose URL has been changed.

guides/setup/gis/web_services guides/setup/gis/README
/guides/setup/gis/web_services/ /guides/setup/gis/README/
16 changes: 8 additions & 8 deletions docs/_redirects/validation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

# The term 'Daily report' was changed to 'Site report' and therefore the location was added to the URL slug.

validation/daily-report validation/site-report
validation/daily-report/2023-11-27 validation/site-report/2023-11-27-NSW1
validation/daily-report/2023-11-26 validation/site-report/2023-11-26-SA1
validation/daily-report/2023-09-22 validation/site-report/2023-09-22-MUL
validation/daily-report/2023-07-25 validation/site-report/2023-07-25-MUL
validation/daily-report/2023-05-09 validation/site-report/2023-05-09-MUL
validation/daily-report/2023-04-22 validation/site-report/2023-04-22-MUL
validation/daily-report/2023-01-17 validation/site-report/2023-01-17-MUL
/validation/daily-report/ /validation/site-report/
/validation/daily-report/2023-11-27/ /validation/site-report/2023-11-27-NSW1/
/validation/daily-report/2023-11-26/ /validation/site-report/2023-11-26-SA1/
/validation/daily-report/2023-09-22/ /validation/site-report/2023-09-22-MUL/
/validation/daily-report/2023-07-25/ /validation/site-report/2023-07-25-MUL/
/validation/daily-report/2023-05-09/ /validation/site-report/2023-05-09-MUL/
/validation/daily-report/2023-04-22/ /validation/site-report/2023-04-22-MUL/
/validation/daily-report/2023-01-17/ /validation/site-report/2023-01-17-MUL/

Loading