JSON-LD Schema Examples

This page demonstrates various JSON-LD structured data schemas. View the page source to see the generated JSON-LD scripts in the <head> section.

Available Schema Types

Testing Your Schema

Use these tools to validate your structured data:

Usage Example

---
import Schema from '~/components/common/Schema.astro';
import { createArticleSchema } from '~/utils/schema';

const schema = createArticleSchema({
  headline: 'My Article Title',
  datePublished: '2024-01-15T08:00:00Z',
  author: {
    '@type': 'Person',
    name: 'Author Name'
  },
  publisher: {
    name: 'Your Site'
  },
  url: Astro.url.href,
});
---

<Layout>
  <Schema schema={schema} />
  <!-- Your page content -->
</Layout>

Note: This demo page should be removed or moved to src/client/pages/ in production to avoid exposing example data to search engines.