From d5d63ad5d8410e81402a32e022f7b492ca0fe928 Mon Sep 17 00:00:00 2001 From: Isaiah Hamilton Date: Thu, 2 Mar 2023 16:33:39 -0500 Subject: [PATCH 1/3] fix: og images --- supabase/functions/og-images/component/Docs.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase/functions/og-images/component/Docs.tsx b/supabase/functions/og-images/component/Docs.tsx index 4ccd920950..bdef605d63 100644 --- a/supabase/functions/og-images/component/Docs.tsx +++ b/supabase/functions/og-images/component/Docs.tsx @@ -36,7 +36,7 @@ const Docs = (props: Props) => {
- {type.substring(0, 1).toUpperCase() + title.substring(1)} + {type.substring(0, 1).toUpperCase() + type.substring(1)} )} From 50fa4d727892c1e94a20d019486c5c9f2eeecea3 Mon Sep 17 00:00:00 2001 From: Isaiah Hamilton Date: Thu, 2 Mar 2023 17:30:03 -0500 Subject: [PATCH 2/3] update types --- apps/docs/layouts/guides/index.tsx | 6 ++---- supabase/functions/og-images/component/Docs.tsx | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx index d6f245d989..465d78c827 100644 --- a/apps/docs/layouts/guides/index.tsx +++ b/apps/docs/layouts/guides/index.tsx @@ -67,11 +67,9 @@ const Layout: FC = (props) => { // page type, ie, Auth, Database, Storage etc const ogPageType = asPath.split('/')[2] // open graph image url constructor - const ogImageUrl = `https://obuldanrptloktxcffvn.functions.supabase.co/og-images?site=docs${ + const ogImageUrl = encodeURIComponent(`https://obuldanrptloktxcffvn.functions.supabase.co/og-images?site=docs${ ogPageType ? `&type=${ogPageType}` : '' - }&title=${encodeURIComponent(props.meta?.title)}&description=${encodeURIComponent( - props.meta?.description - )}` + }&title=${props.meta?.title}&description=${props.meta?.description}`) return ( <> diff --git a/supabase/functions/og-images/component/Docs.tsx b/supabase/functions/og-images/component/Docs.tsx index bdef605d63..5b38579c08 100644 --- a/supabase/functions/og-images/component/Docs.tsx +++ b/supabase/functions/og-images/component/Docs.tsx @@ -9,6 +9,18 @@ type Props = { const Docs = (props: Props) => { const { type, title, description, icon } = props + + let typeName: string | undefined = type?.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()) + let typeIcon: string | undefined = type?.toLowerCase() + + if (type === 'functions' || type === 'function') { + typeName = 'Edge Functions' + } else if (type === 'self-hosting') { + typeIcon = 'resources' + } else if (type === 'cli') { + typeName = 'CLI' + typeIcon = 'reference-cli' + } return (
{ {type && ( <>
- +
- {type.substring(0, 1).toUpperCase() + type.substring(1)} + {typeName} )}
From 1c25a4e2fc369750d817d23815e850609125408c Mon Sep 17 00:00:00 2001 From: Isaiah Hamilton Date: Thu, 2 Mar 2023 17:31:01 -0500 Subject: [PATCH 3/3] run prettier --- apps/docs/layouts/guides/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx index 465d78c827..2895705bc5 100644 --- a/apps/docs/layouts/guides/index.tsx +++ b/apps/docs/layouts/guides/index.tsx @@ -67,9 +67,11 @@ const Layout: FC = (props) => { // page type, ie, Auth, Database, Storage etc const ogPageType = asPath.split('/')[2] // open graph image url constructor - const ogImageUrl = encodeURIComponent(`https://obuldanrptloktxcffvn.functions.supabase.co/og-images?site=docs${ - ogPageType ? `&type=${ogPageType}` : '' - }&title=${props.meta?.title}&description=${props.meta?.description}`) + const ogImageUrl = encodeURIComponent( + `https://obuldanrptloktxcffvn.functions.supabase.co/og-images?site=docs${ + ogPageType ? `&type=${ogPageType}` : '' + }&title=${props.meta?.title}&description=${props.meta?.description}` + ) return ( <>