feat: add authorName and editorName attributes to Strapi blog schema for dynamic author display

This commit is contained in:
Vishva
2026-08-04 13:46:05 +05:30
parent 923c50bfac
commit edee8c2b75
4 changed files with 30 additions and 10 deletions
+10 -2
View File
@@ -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,