This commit is contained in:
Timo Knuth
2026-01-12 16:56:52 +01:00
parent beed961eef
commit 111575aeda
5 changed files with 37 additions and 2 deletions

15
src/lib/schema-utils.ts Normal file
View File

@@ -0,0 +1,15 @@
export function generateFaqSchema(questions: Record<string, { question: string; answer: string }>) {
return {
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: Object.values(questions).map((item) => ({
'@type': 'Question',
name: item.question,
acceptedAnswer: {
'@type': 'Answer',
text: item.answer,
},
})),
};
}