From c8d88489b9124ebc249f5c6077d3714147070140 Mon Sep 17 00:00:00 2001 From: Farnabaz Date: Wed, 20 Nov 2024 16:21:19 +0100 Subject: [PATCH] feat: provice default value for seo title & description --- src/utils/content/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/content/index.ts b/src/utils/content/index.ts index 86969dfdb..7c3f87b33 100644 --- a/src/utils/content/index.ts +++ b/src/utils/content/index.ts @@ -145,5 +145,11 @@ export async function parseContent(key: string, content: string, collection: Res result.rawbody = result.rawbody ?? content } + if (collectionKeys.includes('seo')) { + result.seo = result.seo || {} + result.seo.title = result.seo.title || result.title + result.seo.description = result.seo.description || result.description + } + return result }