Skip to content

Commit cf2b5d3

Browse files
committed
fix components links
1 parent 620e37e commit cf2b5d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pcweb/components/docpage/sidebar/sidebar_items/component_lib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
def get_component_link(category, clist, prefix="") -> str:
77
component_name = rx.utils.format.to_kebab_case(clist[0])
88
# construct the component link. The component name points to the name of the md file.
9-
return f"/docs/library/{prefix.strip('/')}/{category.lower().replace(' ', '-')}/{component_name.lower()}"
9+
if prefix:
10+
return f"/docs/library/{prefix.strip('/')}/{category.lower().replace(' ', '-')}/{component_name.lower()}"
11+
else:
12+
return f"/docs/library/{category.lower().replace(' ', '-')}/{component_name.lower()}"
1013

1114

1215
def get_category_children(category, category_list, prefix=""):

0 commit comments

Comments
 (0)