@@ -102,17 +102,19 @@ def card_inner(meta: dict, path: str) -> rx.Component:
102102 rx .el .div (
103103 rx .image (
104104 src = (
105- meta [ "image" ]
106- if meta [ "image" ] .startswith (("http://" , "https://" ))
107- else f"{ REFLEX_ASSETS_CDN } { meta [ 'image' ] .lstrip ('/' )} "
105+ meta . get ( "image" , "" )
106+ if meta . get ( "image" , "" ) .startswith (("http://" , "https://" ))
107+ else f"{ REFLEX_ASSETS_CDN } { meta . get ( 'image' , '' ) .lstrip ('/' )} "
108108 ),
109109 loading = "eager" ,
110110 custom_attrs = {"fetchPriority" : "high" },
111111 alt = "Image preview for blog post: " + str (meta ["title" ]),
112112 class_name = "group-hover:scale-105 w-full h-full transition-transform duration-150 ease-out object-top object-cover" ,
113113 ),
114114 class_name = "relative flex-shrink-0 border-slate-5 border-b border-solid w-full h-[17.5rem] overflow-hidden" ,
115- ),
115+ )
116+ if meta .get ("image" )
117+ else rx .fragment (),
116118 rx .el .div (
117119 rx .el .span (
118120 meta ["title" ],
@@ -225,11 +227,11 @@ def blogs():
225227 path = route ,
226228 title = seo_title ,
227229 description = document .metadata ["description" ],
228- image = document .metadata [ "image" ] ,
230+ image = document .metadata . get ( "image" , "" ) ,
229231 meta = create_meta_tags (
230232 title = seo_title ,
231233 description = document .metadata ["description" ],
232- image = document .metadata [ "image" ] ,
234+ image = document .metadata . get ( "image" , "" ) ,
233235 url = f"https://reflex.dev{ route } " ,
234236 ),
235237 )(lambda doc = document , route = route : page (doc , route ))
0 commit comments