diff --git a/src/components/seo.jsx b/src/components/seo.jsx index 865601a3..a66ad942 100644 --- a/src/components/seo.jsx +++ b/src/components/seo.jsx @@ -1,6 +1,11 @@ import Head from "next/head"; export default function SEO({ title, description, imageUrl, url }) { + const canonicalUrl = url + ? // eslint-disable-next-line no-restricted-globals, n/prefer-global/process, n/prefer-global/url + new URL(url, process.env.NEXT_PUBLIC_SITE_URL) + : undefined; + return (
@@ -30,10 +35,11 @@ export default function SEO({ title, description, imageUrl, url }) { > )} - {url && ( + {canonicalUrl && ( <> - - + + + > )}