An SEO component to add JSON-LD structured data for a post.
This component works with SvelteKit only.
| Prop | Required | Description |
|---|---|---|
value | yes | Type Post (post from a content collection). |
origin | yes | Website origin, e.g., https://maier.tech. Used for @id and mainEntityOfPage. |
SeoLdPost emits a BlogPosting JSON-LD block in <svelte:head>. It is built from the Post’s frontmatter and from $app/state’s page.url (no
extra props required for URL-aware fields).
Fields included:
headline, description, image (array), datePublished, dateModified (defaults to datePublished when lastmodDate is missing).inLanguage is hardcoded to en.mainEntityOfPage and @id are built from ${origin}${page.url.pathname} (no hash or query
string), so they match the canonical URL emitted by SeoCanonicalUrl.author is included when the post has an author.