Giter Club home page Giter Club logo

svead's Introduction

Svead - Svelte Head Component

All Contributors

MadeWithSvelte.com shield

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.

svead

Props

It takes the following props:

Prop Type Description Required
url string Full URL of the current page Yes
title string Page title Yes
description string Page description Yes
website string Website URL Optional
authorName string Author name Optional
image string Open Graph image URL Optional
paymentPointer string Web Monetization payment pointer Optional
datePublished string Date published in ISO 8601 format Optional
dateModified string Date modified in ISO 8601 format Optional
contentType MainEntityType Content type of the page Optional
language string Language of the page Optional

Use it

npm install svead

Import it into your Svelte pages and use:

<script>
	import { page } from '$app/stores'
	import { Head } from 'svead'

	let title = 'This is Svead a Svelte Head Component'
	let description =
		'Svead, a component that allows you to set head meta information, canonical, title, Twitter and Facebook Open Graph tags.'
	let url = $page.url.toString()
</script>

<Head {title} {description} {image} {url} />

Packaging for NPM

Scott, this is here for you to remember how to do this ๐Ÿ™ƒ

Although I detailed this in Making npm Packages with SvelteKit I think it's best to put it here as I always come to the README and the instructions are never there! ๐Ÿ˜…

Publish the project to NPM

# authenticate with npm
npm login
# bump version with npm
npm version 0.0.8
# package with sveltekit
pnpm run package
# publish
npm publish
# push tags to github
git push --tags

Publish @next package

Same procedure except use the --tag flag:

# authenticate with npm
npm login
# bump version with npm
npm version 0.0.13
# package with sveltekit
pnpm run package
# publish with tag
npm publish --tag next
# push tags to github
git push --tags

Move @next package to latest

# authenticate with npm
npm login
# move @next to latest
npm dist-tag add [email protected] latest

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Scott Spence
Scott Spence

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿšง โš ๏ธ
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

svead's People

Contributors

spences10 avatar renovate[bot] avatar renovate-bot 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.