astro-structured-datav2.0.1

← All examples

Blog post

The reading time becomes an ISO 8601 duration, keywords a list, and mainEntityOfPage the page URL built from siteUrl.

Blog post

examples/blog-post.astro
---
import { ArticleSchema } from '@casoon/astro-structured-data/components';
---

<ArticleSchema
  title="Structured data for Astro sites"
  description="How JSON-LD is generated from typed, validated component props."
  datePublished="2026-09-10"
  dateModified="2026-09-12"
  authorName="Jane Doe"
  imageUrl="/images/structured-data.jpg"
  publisherName="Example Blog"
  publisherLogo="/logo.png"
  inLanguage="en"
  keywords={['astro', 'json-ld', 'seo']}
  readingTimeMinutes={4}
/>
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Structured data for Astro sites",
  "description": "How JSON-LD is generated from typed, validated component props.",
  "datePublished": "2026-09-10",
  "dateModified": "2026-09-12",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://example.com/"
  },
  "author": {
    "@type": "Person",
    "name": "Jane Doe"
  },
  "isAccessibleForFree": true,
  "publisher": {
    "@type": "Organization",
    "name": "Example Blog",
    "logo": {
      "@type": "ImageObject",
      "url": "/logo.png"
    }
  },
  "image": {
    "@type": "ImageObject",
    "url": "/images/structured-data.jpg"
  },
  "inLanguage": "en",
  "keywords": "astro, json-ld, seo",
  "timeRequired": "PT4M"
}
  • BlogPosting
  • ArticleSchema