fix(blog): publish truthful image and team SEO metadata
Deploy Canina / deploy (push) Successful in 4m50s

This commit is contained in:
devops committed 2026-10-25 18:03:49 +00:00
1 parent 5897abcbad
commit 44d74d35e6
4 files changed
+41 -3

No files matched your search

@@ -0,0 +1,12 @@
import { expect, it } from 'vitest';
import { resolveBlogAuthorIdentity } from './blogAuthor';
it('models the specialty team account as Organization without inventing a person', () => {
expect(resolveBlogAuthorIdentity({ author: { firstName: 'کارشناس رفتار و نگهداری', lastName: 'تیم کنینا' }, authorTeam: 'پوست، مو و آلرژی' })).toEqual({
type: 'Organization', name: 'کارشناس رفتار و نگهداری تیم کنینا', teamName: 'پوست، مو و آلرژی',
});
});
it('keeps a named individual a Person even when affiliated with an editorial team', () => {
expect(resolveBlogAuthorIdentity({ author: { firstName: 'سارا', lastName: 'احمدی' }, authorTeam: 'تیم کنینا' }).type).toBe('Person');
});
+4 -1
View File
@@ -32,7 +32,10 @@ export function resolveBlogAuthorIdentity(blog: BlogAuthorInput): ResolvedBlogAu
const teamName = blog.authorTeam?.trim() || BLOG_TEAM_FALLBACK;
if (personName) {
return { type: 'Person', name: personName, teamName };
// Specialty accounts identify themselves as a team, not a named individual.
// An individual's authorTeam affiliation alone does not change their type.
const isTeamAccount = /(?:^|\s)تیم(?:\s|$)/u.test(personName);
return { type: isTeamAccount ? 'Organization' : 'Person', name: personName, teamName };
}
return { type: 'Organization', name: BLOG_AUTHOR_FALLBACK, teamName };