@chirag127/astro-seo
v1.0.0
Published
Minimal Astro SEO component — title, og, twitter, json-ld
Downloads
65
Readme
@chirag127/astro-seo
Minimal Astro SEO component — title, og, twitter, json-ld.
Install
pnpm add @chirag127/astro-seoUsage
---
import SEO from '@chirag127/astro-seo'
---
<head>
<SEO
title="My Page"
description="Page description"
canonical="https://example.com/page"
ogImage="https://example.com/og.png"
twitterHandle="@handle"
jsonLd={{ "@context": "https://schema.org", "@type": "WebPage", "name": "My Page" }}
/>
</head>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | required | Page title |
| description | string | '' | Meta description, og:description, twitter:description |
| canonical | string | '' | Canonical URL, og:url |
| ogImage | string | '' | og:image URL |
| ogType | string | 'website' | og:type |
| twitterHandle | string | '' | twitter:creator handle |
| noindex | boolean | false | Add noindex robots meta |
| jsonLd | Record<string, unknown> | — | JSON-LD object, serialized as <script type="application/ld+json"> |
License
MIT
