Skip to content

Commit

Permalink
Check for empty image
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Sep 15, 2023
1 parent 5c094bc commit e09f19b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/codeforafrica/src/lib/data/seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ function stringifyDescription(description) {

export default function getPageSeoFromMeta(page, settings) {
const { title: pageTitle, meta: pageMeta } = page;
const { title: metaTitle, description: metaDescription, image } = pageMeta;
const {
title: metaTitle,
description: metaDescription,
image = {},
} = pageMeta;
const { title: siteTitle, description: siteDescription } = settings;
const title = metaTitle || pageTitle || siteTitle || null;
const description =
Expand Down

0 comments on commit e09f19b

Please sign in to comment.