@@ -12,18 +12,73 @@ export async function generateMetadata({
1212 params : Promise < { vendorSlug : string } > ;
1313} ) : Promise < Metadata > {
1414 const { vendorSlug } = await params ;
15+
1516 try {
1617 const vendor = await VendorService . getVendorBySlug ( vendorSlug ) ;
18+
19+ if ( ! vendor ) {
20+ return {
21+ title : "Vendor Not Found | Weeshr" ,
22+ description :
23+ "The vendor you're looking for doesn't exist or has been removed." ,
24+ } ;
25+ }
26+
27+ const title = `Find gifts from ${ vendor . name } on Weeshr` ;
28+ const description = "Weeshr |Send gifts to Someone Special" ;
29+ const vendorUrl = `https://weeshr.com/m/${ vendorSlug } ` ;
30+
31+ // Use vendor's image or banner, fallback to Weeshr default
32+ const imageUrl =
33+ vendor . image ||
34+ "https://res.cloudinary.com/drykej1am/image/upload/v1727903584/weeshr_website/ThumbnailWeeshr_1_3_oicmbz.png" ;
35+
1736 return {
18- title : vendor ? `Gift from ${ vendor . name } | Weeshr` : "Vendor Not Found" ,
19- description : vendor
20- ? `Browse gifts from ${ vendor . name } on Weeshr`
21- : "Vendor page not found" ,
37+ title,
38+ description,
39+ keywords : [
40+ vendor . name ,
41+ "gifts" ,
42+ "weeshr" ,
43+ "gift ideas" ,
44+ vendor . category ,
45+ "surprise gifts" ,
46+ "send gifts" ,
47+ "online gifting" ,
48+ "self-gifting" ,
49+ "treat yourself" ,
50+ ] ,
51+ openGraph : {
52+ title,
53+ description,
54+ url : vendorUrl ,
55+ siteName : "Weeshr" ,
56+ images : [
57+ {
58+ url : imageUrl ,
59+ width : 1200 ,
60+ height : 630 ,
61+ alt : `${ vendor . name } on Weeshr` ,
62+ } ,
63+ ] ,
64+ locale : "en_US" ,
65+ type : "website" ,
66+ } ,
67+ twitter : {
68+ card : "summary_large_image" ,
69+ title,
70+ description,
71+ images : [ imageUrl ] ,
72+ } ,
73+ alternates : {
74+ canonical : vendorUrl ,
75+ } ,
2276 } ;
2377 } catch ( error ) {
2478 return {
25- title : "Vendor Not Found" ,
26- description : "Vendor page not found" ,
79+ title : "Vendor Not Found | Weeshr" ,
80+ description :
81+ "The vendor you're looking for doesn't exist or has been removed." ,
2782 } ;
2883 }
2984}
0 commit comments