From ae674bb73d16ae494d88194ec95b8fec9ffff9a9 Mon Sep 17 00:00:00 2001 From: Dominic Tran Date: Tue, 23 Jun 2026 14:05:25 -0500 Subject: [PATCH] Unlist replica-aware routing page from nav and search (DOC-849) Add `unlisted: true` to the replica-aware routing page so it drops from the autogenerated sidebar, the sitemap, and is tagged noindex, while staying reachable by direct URL. Teach the Algolia indexer (scripts/search/index_pages.py) to read and skip pages with `unlisted`/`draft` set in frontmatter. The indexer previously ignored these flags, so unlisted pages were still surfaced in site search. This removes the replica-aware routing page (and 7 other already-unlisted pages that were being indexed by mistake). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../05_infrastructure/replica-aware-routing.md | 1 + scripts/search/index_pages.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/cloud/features/05_infrastructure/replica-aware-routing.md b/docs/cloud/features/05_infrastructure/replica-aware-routing.md index 48dd053a502..a6295ce497c 100644 --- a/docs/cloud/features/05_infrastructure/replica-aware-routing.md +++ b/docs/cloud/features/05_infrastructure/replica-aware-routing.md @@ -4,6 +4,7 @@ slug: /manage/replica-aware-routing description: 'How to use Replica-aware routing to increase cache re-use' keywords: ['cloud', 'sticky endpoints', 'sticky', 'endpoints', 'sticky routing', 'routing', 'replica aware routing'] doc_type: 'guide' +unlisted: true --- import PrivatePreviewBadge from '@theme/badges/PrivatePreviewBadge'; diff --git a/scripts/search/index_pages.py b/scripts/search/index_pages.py index 36afda64cd8..f5578816086 100644 --- a/scripts/search/index_pages.py +++ b/scripts/search/index_pages.py @@ -81,12 +81,17 @@ def read_metadata(text): for part in parts: parts = part.split(":") if len(parts) == 2: - if parts[0] in ['title', 'description', 'slug', 'keywords', 'score', 'doc_type']: + if parts[0] in ['title', 'description', 'slug', 'keywords', 'score', 'doc_type', 'unlisted', 'draft']: value = parts[1].strip() # Strip quotes only from doc_type if parts[0] == 'doc_type': value = value.strip("'\"") - metadata[parts[0]] = int(value) if parts[0] == 'score' else value + if parts[0] == 'score': + metadata[parts[0]] = int(value) + elif parts[0] in ['unlisted', 'draft']: + metadata[parts[0]] = value.strip("'\"").lower() == 'true' + else: + metadata[parts[0]] = value return metadata @@ -423,6 +428,12 @@ def process_markdown_directory(directory, base_directory, base_url): if md_file_path not in files_processed: files_processed.add(md_file_path) metadata, content = parse_metadata_and_content(directory, base_directory, md_file_path) + # Skip pages hidden from search via frontmatter. `unlisted` pages are + # excluded from the sidebar and tagged `noindex` by Docusaurus; `draft` + # pages are dropped from production builds entirely. Neither should be + # indexed, but they remain reachable by direct URL. + if metadata.get('unlisted') or metadata.get('draft'): + continue for sub_doc in parse_markdown_content(metadata, content, base_url): url_without_anchor, anchor = split_url_and_anchor(sub_doc['url']) sub_doc['url_without_anchor'] = url_without_anchor