Skip to content

Commit c83b66d

Browse files
Fix -ll suffix handling to use _ll for underscore normalization
- Update URL path generation in typesense_indexer.py to handle _ll suffix - Update component documentation file existence check to look for _ll.md files - Update low-level documentation file path replacement to use _ll.md - Update file exclusion logic to skip _ll.md files instead of -ll.md This fixes the CI prerendering error for /docs/library/forms/form-ll/ by ensuring the routing system properly recognizes the normalized underscore file naming. Co-Authored-By: [email protected] <[email protected]>
1 parent 7c82a33 commit c83b66d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pcweb/pages/docs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def get_component(doc: str, title: str):
140140
if doc.endswith("-style.md"):
141141
return
142142

143-
if doc.endswith("-ll.md"):
143+
if doc.endswith("_ll.md"):
144144
return
145145

146146
# Get the docpage component.

pcweb/pages/docs/component.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ def multi_docs(path, comp, component_list, title):
10811081
component_docs(component_tuple, comp) for component_tuple in component_list[1:]
10821082
]
10831083
fname = path.strip("/") + ".md"
1084-
ll_doc_exists = os.path.exists(fname.replace(".md", "-ll.md"))
1084+
ll_doc_exists = os.path.exists(fname.replace(".md", "_ll.md"))
10851085

10861086
active_class_name = "font-small bg-slate-2 p-2 text-slate-11 rounded-xl shadow-large w-28 cursor-default border border-slate-4 text-center"
10871087

@@ -1145,7 +1145,7 @@ def out():
11451145
@docpage(set_path=path + "low", t=title + " (Low Level)")
11461146
def ll():
11471147
nonlocal fname
1148-
fname = fname.replace(".md", "-ll.md")
1148+
fname = fname.replace(".md", "_ll.md")
11491149
d2 = Document.from_file(fname)
11501150
toc = get_toc(d2, fname, component_list)
11511151
return toc, rx.box(

scripts/typesense_indexer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ def normalize_slug(s: str) -> str:
114114
path_parts = [normalize_slug(p) for p in rel_path.parts[:-1]] # Remove filename and normalize
115115
url_path = '/' + '/'.join(['docs'] + path_parts)
116116
if file_path.name != 'index.md':
117-
# Handle special case: replace -ll suffix with /low
117+
# Handle special case: replace _ll suffix with /low
118118
stem = normalize_slug(file_path.stem)
119-
if stem.endswith('-ll'):
120-
stem = stem[:-3] # Remove -ll
119+
if stem.endswith('_ll'):
120+
stem = stem[:-3] # Remove _ll
121121
url_path += '/' + stem + '/low'
122122
else:
123123
url_path += '/' + stem

0 commit comments

Comments
 (0)