From ef10113bb791b1f192468d12655562f56967506e Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Wed, 4 Sep 2024 14:52:06 -0400 Subject: [PATCH] fix all occurrences of uppercase links in markdown (#26684) --- docs/hooks/contributing_path.py | 10 ++++++++++ docs/index.md | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/hooks/contributing_path.py b/docs/hooks/contributing_path.py index b4b23e48cefc..06e4a26020cf 100644 --- a/docs/hooks/contributing_path.py +++ b/docs/hooks/contributing_path.py @@ -21,6 +21,8 @@ collisions in this case, because the URL looks nicer. """ +import re + transforms = { "CONTRIBUTING": "contributing", "CODE_OF_CONDUCT": "code_of_conduct", @@ -34,3 +36,11 @@ def on_page_markdown(markdown, *, page, config, files): page.file.url = page.file.url.replace(old, new) page.file.dest_uri = page.file.dest_uri.replace(old, new) page.file.abs_dest_path = page.file.abs_dest_path.replace(old, new) + + # Can't just replace filename and keep extension, + # mkdocs will get upset it can't find a file with + # that exact name. So we just give it a URL and it + # complains, but ignores it and chugs along. + markdown = re.sub(f"\.+/{old}.md", f"/{new}/", markdown) + + return markdown diff --git a/docs/index.md b/docs/index.md index 54b6c1aadc0d..2f0375d6f06a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,8 +5,8 @@ necessary to get started making contributions to Paradise Station. ## Required Reading -All contributors are expected to read and abide by the Paradise Station [Code of -Conduct](./CODE_OF_CONDUCT.md) and [Contribution Guidelines](./CONTRIBUTING.md). +All contributors are expected to read and abide by the Paradise Station [Code of Conduct](./CODE_OF_CONDUCT.md) and +[Contribution Guidelines](./CONTRIBUTING.md). ## New Contributors