Schema guides Platform
How to add schema to Astro
Category: framework
Plugins and apps
- @astrojs/mdx
- Manual Seo component + script tag
Manual implementation
Layout or page frontmatter → pass props to a Seo component; emit `<script type="application/ld+json">` server-side.
Troubleshooting
- Client island only content
Keep JSON-LD in static shell; crawlers may not run islands. - Trailing slash vs canonical
Match `trailingSlash` config in graph URLs.
Overview
This site is Astro: schema belongs in layouts or pages, computed from content collections or props—never only inside client-loaded React islands unless duplicated in the shell.
Follow SITE.url and trailingSlash config when building canonical URLs in JSON-LD, same as this blog's Article pages.