1.13.0 • Published 6 months ago
@zfben/astro-head v1.13.0
Effortless SEO for Astro with @zfben/astro-head
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.
Key Features
- Simplified Integration: Seamlessly integrate SEO elements directly within your Astro components. No complex configurations needed!
- Automated Meta Generation: Automatically generate open graph and twitter meta tags, saving you time and ensuring consistent data across your site.
- Leverages Astro Configuration: Utilizes your existing site settings in astro.config.js to automatically generate accurate URLs within meta tags.
- SEO Best Practices: Follows SEO best practices to ensure your website is optimized for search engines.
Getting Started
- Installation: Install the package using npm:
npm install @zfben/astro-head
- Configuration: Ensure you have a site property defined within your astro.config.js file. This provides the base URL for your website.
- Import and Usage: Import the Head component from the package and use it within your Astro components:
---
import { Head } from "@zfben/astro-head";
---
<html>
<head>
<Head
title="Hello world"
path="/"
/>
</head>
</html>
Supported Props
Prop | Output | Format | |||
---|---|---|---|---|---|
disableSEO | Disable SEO advices in log output | boolean, default is false | |||
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 | summary_large_image | app | player , default is 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 | |||
adsense | AdSense's tracking code | string | |||
ahrefs | Ahrefs Web Analytics | string | |||
scp | Content Security Policy | string, default is default-src 'self'; img-src https://*; child-src 'none'; |
Links
1.13.0
6 months ago
1.12.0
7 months ago
1.11.0
8 months ago
1.10.2
9 months ago
1.9.1
9 months ago
1.9.0
9 months ago
1.10.1
9 months ago
1.10.0
9 months ago
1.8.1
10 months ago
1.8.0
10 months ago
1.7.1
11 months ago
1.7.0
11 months ago
1.6.0
1 year ago
1.5.0
1 year ago
1.4.0
1 year ago
1.3.1
1 year ago
1.3.0
1 year ago
1.2.1
1 year ago
1.2.0
1 year ago
1.1.0
1 year ago
1.0.0
1 year ago