File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1+ import re
2+
13import reflex as rx
24import reflex_ui as ui
35from reflex .experimental .client_state import ClientStateVar
@@ -107,6 +109,7 @@ def code_card(app: dict) -> rx.Component:
107109
108110
109111def gallery_app_card (app : dict [str , str ]) -> rx .Component :
112+ slug = re .sub (r"[\s_]+" , "-" , app ["title" ]).lower ()
110113 return rx .flex (
111114 rx .box (
112115 rx .link (
@@ -116,7 +119,7 @@ def gallery_app_card(app: dict[str, str]) -> rx.Component:
116119 alt = "Image preview for app: " + app ["title" ],
117120 class_name = "size-full duration-150 object-cover hover:scale-105 transition-transform ease-out" ,
118121 ),
119- href = f"/docs/getting-started/open-source-templates/{ app [ 'title' ]. replace ( ' ' , '-' ). lower () } " ,
122+ href = f"/docs/getting-started/open-source-templates/{ slug } " ,
120123 ),
121124 class_name = "relative border-slate-5 border-b border-solid w-full overflow-hidden h-[180px]" ,
122125 ),
You can’t perform that action at this time.
0 commit comments