From 94edf4d3d7d63e5261b5d4f297760d3eb261aa58 Mon Sep 17 00:00:00 2001 From: "Hong Jing (Jingles)" Date: Mon, 11 Nov 2024 12:22:46 +0800 Subject: [PATCH 1/2] attempt to improve og --- .../src/components/site/metatags.tsx | 38 ++++++++++++------- apps/playground/src/pages/api/og.tsx | 2 +- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/apps/playground/src/components/site/metatags.tsx b/apps/playground/src/components/site/metatags.tsx index 86e302c7e..1c806c1d9 100644 --- a/apps/playground/src/components/site/metatags.tsx +++ b/apps/playground/src/components/site/metatags.tsx @@ -4,12 +4,10 @@ export default function Metatags({ title, keywords, description, - image, }: { title?: string; keywords?: string; description?: string; - image?: string; }) { if (description === undefined) { description = @@ -19,49 +17,63 @@ export default function Metatags({ keywords = "developer, tools, cardano, blockchain, sdk, plutus, crypto, web3, metaverse, gaming, ecommerce, nfts, apis, aiken"; } + + let _title = title; if (title === undefined) { - title = "Cardano Web3 TypeScript SDK & off-chain Framework"; + _title = "Mesh JS - Cardano Web3 TypeScript SDK & Off-Chain Framework"; + } else { + title = title + " - Mesh JS"; } - title = title + " - Mesh JS"; - return ( - {title} + {title ? title : _title} - - + + - {image ? ( + {/* {image ? ( ) : ( + )} */} + {title && ( + )} - + - + - {image ? ( + {/* {image ? ( ) : ( + )} */} + {title && ( + )} - + Date: Mon, 11 Nov 2024 12:27:53 +0800 Subject: [PATCH 2/2] fix build error --- .../src/components/site/metatags.tsx | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/apps/playground/src/components/site/metatags.tsx b/apps/playground/src/components/site/metatags.tsx index 1c806c1d9..9bfb2de36 100644 --- a/apps/playground/src/components/site/metatags.tsx +++ b/apps/playground/src/components/site/metatags.tsx @@ -4,10 +4,12 @@ export default function Metatags({ title, keywords, description, + image, }: { title?: string; keywords?: string; description?: string; + image?: string; }) { if (description === undefined) { description = @@ -38,15 +40,10 @@ export default function Metatags({ - {/* {image ? ( + {image && ( - ) : ( - - )} */} - {title && ( + )} + {title && image === undefined && ( - {/* {image ? ( - - ) : ( - - )} */} - {title && ( + {image && ( + + )} + {title && image === undefined && (