Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 654fe1e

Browse files
authored
Refactor search index build script to exclude specific directories. Removed 'main-concepts' from EXCLUDED_FILES and added it to EXCLUDED_DIRS for better organization of excluded paths. (#361)
1 parent 50791db commit 654fe1e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/build_search_index.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131

3232
CONTENT_REGEX = re.compile(r"<(.*?)>", re.DOTALL | re.MULTILINE)
3333

34-
STABLE_VERSION = "1.2.x"
35-
36-
EXCLUDED_FILES = {"gdpr-banner", "menu", "main-concepts"}
34+
EXCLUDED_FILES = {"gdpr-banner", "menu"}
35+
EXCLUDED_DIRS = {"main-concepts"}
3736

3837

3938
class AlgoliaDoc(BaseModel):
@@ -101,7 +100,10 @@ def build_index(version: Path):
101100
file
102101
for file in version.rglob("*.[mM][dD]")
103102
if file.stem not in EXCLUDED_FILES
103+
and file.parent.name not in EXCLUDED_DIRS
104+
and not any(substring in str(file.parent) for substring in EXCLUDED_DIRS)
104105
]
106+
105107

106108
algolia_docs = (get_algolia_doc_from_file(page) for page in results)
107109
docs = [json.loads(doc.json()) for doc in algolia_docs if doc]

0 commit comments

Comments
 (0)