Skip to content

Commit

Permalink
Fix null SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Oct 18, 2024
1 parent 48de42b commit 79baf19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/climatemappedafrica/src/pages/[[...slug]].js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const componentsBySlugs = {

function Index({ blocks, menus, footer: footerProps, seo = {}, fallback }) {
const pageSeo = {};
pageSeo.title = seo?.title || undefined;
pageSeo.description = seo?.metaDesc || undefined;
pageSeo.canonical = seo?.canonical || undefined;
pageSeo.title = seo?.title || null;
pageSeo.description = seo?.metaDesc || null;
pageSeo.canonical = seo?.canonical || null;
if (seo?.opengraphType || seo?.opengraphImage) {
pageSeo.openGraph = {};
if (seo.opengraphImage) {
pageSeo.openGraph.images = [
{
url: seo.opengraphImage,
alt: seo.title || undefined,
alt: seo.title || null,
},
];
}
Expand Down

0 comments on commit 79baf19

Please sign in to comment.