(
faqs: Array<{ question: string; answer: string }>
)
| 125 | * Generate FAQPage structured data for category pages |
| 126 | */ |
| 127 | export function createFAQSchema( |
| 128 | faqs: Array<{ question: string; answer: string }> |
| 129 | ): WithContext<FAQPage> { |
| 130 | return { |
| 131 | '@context': 'https://schema.org', |
| 132 | '@type': 'FAQPage', |
| 133 | mainEntity: faqs.map((faq) => ({ |
| 134 | '@type': 'Question' as const, |
| 135 | name: faq.question, |
| 136 | acceptedAnswer: { |
| 137 | '@type': 'Answer' as const, |
| 138 | text: faq.answer, |
| 139 | }, |
| 140 | })), |
| 141 | }; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Serialize structured data to JSON string for embedding in HTML |
nothing calls this directly
no outgoing calls
no test coverage detected