Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/spences10/svead

Svead, a component that allows you to set head meta information, canonical, title, Twitter and Facebook Open Graph tags.
https://github.com/spences10/svead

canonical component head links metatags svelte sveltekit

Last synced: 3 months ago
JSON representation

Svead, a component that allows you to set head meta information, canonical, title, Twitter and Facebook Open Graph tags.

Awesome Lists containing this project

README

        

# Svead 🍺 - Svelte Head Component

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)

[![MadeWithSvelte.com shield](https://madewithsvelte.com/storage/repo-shields/4099-shield.svg)](https://madewithsvelte.com/p/svead/shield-link)

[![Tests: E2E](https://github.com/spences10/svead/actions/workflows/e2e-ci.yml/badge.svg)](https://github.com/spences10/svead/actions/workflows/e2e-ci.yml)

[![Tests: Unit](https://github.com/spences10/svead/actions/workflows/unit-test.yml/badge.svg)](https://github.com/spences10/svead/actions/workflows/unit-test.yml)

Svead, a component that allows you to set head meta information,
canonical, title, Twitter and Facebook Open Graph tags.

Also supports JSON-LD for SEO with the `SchemaOrg` component.

![svead](.github/svead.svg)

## Name

The name was meant to be Svelte + Head, but I like Puru's suggestion
of Svelte + Mead

## v0.0.4 vs v1

v1 is currently available via `pnpm i -D svead@next` and will be that
way until Svelte 5 comes out of RC phase.

v1 has changed compared to v0.0.4. The main change is that the there's
one config object with `SeoConfig`.

Separated out the `SchemaOrg` component from the `Head` component
which can be optionally used to add structured data to your web pages.

```svelte

import { Head, SchemaOrg } from 'svead';
import type { SeoConfig, SchemaOrgProps } from 'svead';

const seo_config: SeoConfig = {
title: 'Welcome to My Site',
description: 'This is a simple web page example.',
url: 'https://example.com/welcome',
};

const schema_org: SchemaOrgProps['schema'] = {
'@type': 'WebPage',
name: 'Welcome to My Site',
description: 'This is a simple web page example.',
url: 'https://example.com/welcome',
};