diff --git a/src/components/SEO/SEO.tsx b/src/components/SEO/SEO.tsx index dc3b369..46595b5 100644 --- a/src/components/SEO/SEO.tsx +++ b/src/components/SEO/SEO.tsx @@ -39,6 +39,7 @@ export default function SEO({ image?.alt && ogSearchParams.set('alt', image?.alt || '') contentType && ogSearchParams.set('contentType', contentType) date && ogSearchParams.set('date', date || '') + pagePath && ogSearchParams.set('pagePath', pagePath || '') const ogUrl = `${imageUrl}?${ogSearchParams.toString()}` @@ -62,11 +63,7 @@ export default function SEO({ - {image ? ( - - ) : ( - - )} + ) diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 1943bc2..9f8183e 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -11,6 +11,7 @@ const NotFoundPage = () => { description={'Description'} imageUrl={undefined} tags={[]} + pagePath={`/404`} /> diff --git a/src/pages/[slug].tsx b/src/pages/[slug].tsx index cf788f2..f90b076 100644 --- a/src/pages/[slug].tsx +++ b/src/pages/[slug].tsx @@ -32,6 +32,7 @@ const Page: CustomNextPage = ({ 'Logos online publishing and blogging platform for writers and readers.' } title={`${data.page.title} - Logos Press Engine`} + pagePath={`/${data.page.slug}`} /> diff --git a/src/pages/api/og.tsx b/src/pages/api/og.tsx index 4881947..471635d 100644 --- a/src/pages/api/og.tsx +++ b/src/pages/api/og.tsx @@ -21,10 +21,12 @@ export default async function handler(request: NextRequest) { ).then((res) => res.arrayBuffer()) const searchParams = new URL(href).searchParams - const title = searchParams.get('title') || 'LOGOS→PRESS ENGINE' + const contentType = searchParams.get('contentType') + const title = + contentType == null ? 'LOGOS→PRESS ENGINE' : searchParams.get('title') const image = searchParams.get('image') || '' const alt = searchParams.get('alt') || '' - const contentType = searchParams.get('contentType') + const pagePath = searchParams.get('pagePath') || '/' const date = searchParams.get('date') const imgSrc = image @@ -120,7 +122,7 @@ export default async function handler(request: NextRequest) { fontFamily: 'Inter', }} > -

{contentType ?? '/'}

+

{contentType ?? pagePath}

{date &&

} {date &&

{`${day} ${month} ${year}`}

} diff --git a/src/pages/search.tsx b/src/pages/search.tsx index 5d739bd..326897d 100644 --- a/src/pages/search.tsx +++ b/src/pages/search.tsx @@ -90,6 +90,7 @@ export default function SearchPage({ topics, shows }: SearchPageProps) { 'Logos online publishing and blogging platform for writers and readers.' } title={'Logos Press Engine'} + pagePath={`/search`} />