From 356b19ba437fe56909764f1c0d33459458bd39b9 Mon Sep 17 00:00:00 2001 From: Hang Yin Date: Tue, 10 Mar 2026 23:02:06 -0700 Subject: [PATCH] fix: check file existence in link validator for unlisted pages Pages that exist on disk but aren't in the sidebar nav are still accessible via direct URL. Update check_links.py to treat these as valid instead of flagging them as uncovered. Co-Authored-By: Claude Opus 4.6 --- .scripts/check_links.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.scripts/check_links.py b/.scripts/check_links.py index d7de14c3..9a75f618 100644 --- a/.scripts/check_links.py +++ b/.scripts/check_links.py @@ -202,7 +202,12 @@ def main(): if destination: redirected_links.append((normalized_link, destination)) else: - uncovered_links.append(normalized_link) + # Check if the .mdx file exists on disk (page exists but not in nav) + mdx_path = Path(f"{normalized_link}.mdx") + if mdx_path.exists(): + accessible_links_list.append(normalized_link) + else: + uncovered_links.append(normalized_link) # Report results print(f"\nšŸ”— ACCESSIBLE LINKS ({len(accessible_links_list)}):")