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
+5 -1
View File
@@ -145,7 +145,11 @@ export default function BlogDetailPage({ blog, allBlogs = [], isMobile, onNaviga
const bgPatternUrl = assetUrl('/assets/Background pattern About Us Hero section.svg');
const spotlightUrl = assetUrl('/assets/Spotlight vector.svg');
const authorName = typeof blog.author === 'string' ? blog.author : (blog.author?.firstname ? `${blog.author.firstname} ${blog.author.lastname || ''}`.trim() : 'Purushothaman Gopalan');
const authorName = (typeof blog.authorName === 'string' && blog.authorName.trim())
? blog.authorName.trim()
: (typeof blog.author === 'string' && blog.author.trim()
? blog.author.trim()
: (blog.author?.firstname ? `${blog.author.firstname} ${blog.author.lastname || ''}`.trim() : 'Cavin Editorial Team'));
const authorRole = typeof blog.authorDesignation === 'string' ? blog.authorDesignation : 'Chief AI Architect & Head of Data Engineering';
const authorAvatar = '/assets/arvindh_agentic_ai.jpg';
const relatedArticles = allBlogs.filter(b => b.id !== blog.id).slice(0, 2);