Effortless SEO for Astro with @zfben/astro-head
MIT License
Managing SEO for your Astro website just got easier with @zfben/astro-head. This package simplifies the process of adding essential meta tags and open graph/twitter meta data to your Astro components, boosting your website's search engine visibility.
npm install @zfben/astro-head
---
import { Head } from "@zfben/astro-head";
---
<html>
<head>
<Head
title="Hello world"
path="/"
/>
</head>
</html>
Prop | Output | Format |
---|---|---|
title |
title , og:title , twitter:title
|
string, required |
path |
canonical , url , og:url , twitter:url
|
string, required, must be started with /
|
type |
og:type |
string, default is website
|
charset |
charset |
string, default is utf-8
|
lang |
og:locale |
string |
description |
description , og:description , twitter:description
|
string |
image |
image , og:image , twitter:image
|
string |
siteName |
og:site_name |
string |
author |
author , article:author
|
string |
twitter |
twitter:site , twitter:creator
|
string, must be started with @
|
twitterCard |
twitter:card |
string, one of summary
|
alternates |
alternate , og:locale:alternate
|
lang , path and default list |
ga |
Google Analytics' tracking code | string, must be started with G-
|
clarity |
Clarity's tracking code | string |
scp |
Content Security Policy | string, default is default-src 'self'; img-src https://*; child-src 'none';
|