astro-meta-engine
v1.0.5
Published
📦️ Powerful, type-safe metadata and JSON-LD engine for Astro.
Downloads
999
Maintainers
Readme
- node >= 22.17.0
- bun >= 1.1.0
bun i -D astro-meta-enginenpm i -D astro-meta-enginepnpm i -D astro-meta-engineyarn i -D astro-meta-engineTo use this packages you have the principal component Seo, that is the main component to manage all the metadata of your website, and the OpenGraph component, that is a subcomponent of Seo, to manage all the open graph metadata of your website.
---
import { Seo } from "astro-meta-engine";
---
<Seo
title="Astro"
description="Astro"
keywords={["astro", "meta", "engine", "seo", "metadata", "open graph", "twitter cards"]}
/>You can use separate components for each type of metadata, such as OpenGraph, TwitterCard, etc. For example:
---
import { MetaAuthor } from "astro-meta-engine";
---
<MetaAuthor
copyright="Copyright © All rights reserved"
author={{
web: "https://google.com",
name: "LuisdaByte",
email: ""
}}
/>Here is the Seo component full configuration:
---
import { Seo } from "astro-meta-engine";
---
type Props = {
schema?: Record<string, unknown>;
};
<Seo
title="Astro"
description="Astro"
keywords={["astro", "meta", "engine", "seo", "metadata", "open graph", "twitter cards"]}
charset="UTF-8"
xUACompatible="IE=edge"
viewportValue="width=device-width, initial-scale=1.0"
googleAnalytic={{ googleAnalyticId: "G-XXXXXXXXXX", showGoogleAnalytic: true }}
showCanonical={true}
rss={{
rssPath: "/rss.xml",
siteName: "Astro SEO Kit",
showRss: true
}}
favicon={{
png: "/favicon.png",
svg: "/favicon.svg",
ico: "/favicon.ico",
apple: "/apple-touch-icon.png",
manifest: "/site.webmanifest"
}}
sitemap={{
sitemapPath: "/sitemap.xml",
showSitemap: true
}}
metaRobot={{
noIndex: "noindex",
noFollow: "nofollow",
extraRobots: "max-snippet:-1, max-image-preview:large, max-video-preview:-1"
}}
metaAuthor={{
copyright: "Copyright © All rights reserved",
author: {
web: "https://google.com",
name: "LuisdaByte",
email: ""
}
}}
openGraph={{
title: "Astro",
description: "Astro",
url: "https://google.com",
type: "website",
siteName: "Astro SEO Kit",
locale: "en_US",
image: {
url: "https://google.com/og-image.png",
alt: "Astro SEO Kit Open Graph Image"
}
}}
languageAlternative={{
defaultLanguage: "en",
languages: ['en', 'es', 'fr'],
}}
schema={{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Astro SEO Kit",
"url": "https://google.com",
"sameAs": [
"https://www.facebook.com/google",
"https://www.twitter.com/google",
"https://www.linkedin.com/company/google"
]
}}
/>