svelte-meta
v1.0.2
Published
Easily generate SEO metadata for Svelte
Maintainers
Readme
Svelte Meta
Easily generate SEO metadata for Svelte.
Features
- Automatically set relevant social meta tags common attributes like
titleanddescription - Automatically set relevant JSON-LD metadata
- Shorthands for setting Open Graph and Twitter metadata
- Shorthands for setting URL, Sitemap, and other technical SEO data
Usage
npm i svelte-meta<script>
import Meta from 'svelte-meta';
</script>
<Meta
title="My Page"
description="It's a great page"
image="/cover.png"
url="https://website.com/page
/>Properties
| Property | Type | Description | Metadata Set |
| ------------- | ------------------------------------------------------------------------ | --------------------------------------- | ------------------------------- |
| title | string | Title of your project | <title>, title, og:title |
| description | string | Descriptoin of your project | description, og:description |
| image | string or { url: string; width: number; height: number; alt: string} | Image for social networks | og:image |
| url | string | URL of the current page | canonical og:url |
| siteUrl | string | Root URL of your website | JSON-LD |
| logo | string | Logo image for your brand | JSON-LD |
| search | string | Search page base URL | JSON-LD |
| sitemap | string | URL of your sitemap | sitemap |
| openGraph | Inherits other properties, plus custom og: properties, eg: video | OpenGraph properties | og: |
Notes
- Twitter inherits Open Graph (
og:) properties iftwitter:specific metadata is not set, which is whysvelte-metadoesn't include them
