File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
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 ),
Original file line number Diff line number Diff line change @@ -50,9 +50,7 @@ def load_all_gallery_apps():
5050 paths = flexdown .utils .get_flexdown_files (folder )
5151 for path in sorted (paths , reverse = True ):
5252 document = flexdown .Document .from_file (path ) # This has metadata
53- document .metadata ["title" ] = (
54- document .metadata .get ("title" , "Untitled" ).replace ("_" , " " ).title ()
55- )
53+ document .metadata ["title" ] = document .metadata .get ("title" , "Untitled" )
5654 clean_path = str (path ).replace (".md" , "/" )
5755 gallery_apps [(clean_path , folder )] = document
5856 return gallery_apps
You can’t perform that action at this time.
0 commit comments