feat: add authorName and editorName attributes to Strapi blog schema for dynamic author display
This commit is contained in:
+10
-2
@@ -81,9 +81,17 @@ export async function getStrapiBlogs() {
|
||||
date: dateStr,
|
||||
image: coverUrl,
|
||||
slug: b.slug,
|
||||
author: typeof b.author === 'string' ? b.author : (b.author?.firstname ? `${b.author.firstname} ${b.author.lastname || ''}`.trim() : (b.author?.username || 'Dr. Arvindh Ramachandran')),
|
||||
author: (typeof b.authorName === 'string' && b.authorName.trim())
|
||||
? b.authorName.trim()
|
||||
: (typeof b.author === 'string' && b.author.trim()
|
||||
? b.author.trim()
|
||||
: (b.author?.firstname ? `${b.author.firstname} ${b.author.lastname || ''}`.trim() : (b.author?.username || 'Cavin Editorial Team'))),
|
||||
authorDesignation: b.authorDesignation || 'Chief AI Architect & Head of Data Engineering',
|
||||
editor: typeof b.editor === 'string' ? b.editor : (b.editor?.firstname ? `${b.editor.firstname} ${b.editor.lastname || ''}`.trim() : (b.editor?.username || null)),
|
||||
editor: (typeof b.editorName === 'string' && b.editorName.trim())
|
||||
? b.editorName.trim()
|
||||
: (typeof b.editor === 'string' && b.editor.trim()
|
||||
? b.editor.trim()
|
||||
: (b.editor?.firstname ? `${b.editor.firstname} ${b.editor.lastname || ''}`.trim() : (b.editor?.username || null))),
|
||||
editorDesignation: b.editorDesignation || null,
|
||||
tags: b.tags || [],
|
||||
metaTitle: b.metaTitle || null,
|
||||
|
||||
Reference in New Issue
Block a user