Git Product home page Git Product logo

astro-head's Introduction

Effortless SEO for Astro with @zfben/astro-head

License: MIT NPM Version

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.

Getting Started

  1. Installation: Install the package using npm: npm install @zfben/astro-head
  2. Configuration: Ensure you have a site property defined within your astro.config.js file. This provides the base URL for your website.
  3. 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
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 and path 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';

Links

astro-head's People

Contributors

dependabot[bot] avatar zfben avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.