astro-structured-datav2.0.1

← All examples

FAQ page

Question and answer pairs as a FAQPage with Question and Answer items.

FAQ page

examples/faq.astro
---
import { FAQSchema } from '@casoon/astro-structured-data/components';
---

<FAQSchema
  questions={[
    { question: 'What is this?', answer: 'An Astro integration.' },
    { question: 'How does it work?', answer: 'It injects JSON-LD.' },
  ]}
/>
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is this?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "An Astro integration."
      }
    },
    {
      "@type": "Question",
      "name": "How does it work?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "It injects JSON-LD."
      }
    }
  ]
}
  • FAQPage
  • FAQSchema