From 6e71624390ff654431284d38945c105e5fc3dcaf Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:09:59 +0300 Subject: [PATCH] Confitional url --- apps/codeforafrica/src/lib/data/seo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/codeforafrica/src/lib/data/seo.js b/apps/codeforafrica/src/lib/data/seo.js index 8a7b057b2..62890cbf4 100644 --- a/apps/codeforafrica/src/lib/data/seo.js +++ b/apps/codeforafrica/src/lib/data/seo.js @@ -26,7 +26,7 @@ export default function getPageSeoFromMeta(page, settings) { metaDescription || stringifyDescription(siteDescription) || null; const titleTemplate = siteTitle ? `%s | ${siteTitle}` : null; const defaultTitle = siteTitle || null; - const canonical = site.url.replace(/\/+$/, ""); + const canonical = site?.url?.replace(/\/+$/, ""); const openGraph = { title, description,