1.0.8 • Published 3 years ago

use-seo v1.0.8

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

🔍 use-seo

All Contributors

SEO is complicated, but what if you had a React hook that gave you all you need for your page.

You are on the right place.

useSeo is a React hook that based on some of your site properties, will return all the necessary tags you need to improve your SEO.

Install

npm install use-seo

Basic Usage

import { Helmet } from 'react-helmet'
import { useSeo } from 'use-seo'

function App() {
  const { title, meta } = useSeo({
    title: 'My App'
    description: 'This app is awesome!'
    url: 'https://www.myawesomeapp.io',
    keywords: 'Awesome, App, React',
    image: 'https://www.myawesomeapp.io/images/logo.png'
  })

  return (
    <div>
      <Helmet>
        {title}
        {meta}
      </Helmet>
    </div>
  )
}

Options

NameTypeOptional
titleStringYes
descriptionStringYes
urlStringYes
keywordsStringYes
imageStringYes
imageAltStringYes
localeStringYes
typeStringYes
authorStringYes
datePublishedStringYes
dateModifiedStringYes

Returns

title

<title>My App</title>

meta

<meta name="description" content="This app is awesome!" />
<meta name="keywords" content="Awesome, App, React" />
<meta property="og:image" content="https://www.myawesomeapp.io/images/logo.png" />
...

jsonLD

<script type="application/ld+json">
  {
    "@id": "http://store.example.com/",
    "@type": "Store",
    "name": "Links Bike Shop",
    "description": "The most \"linked\" bike store on earth!"
  }
</script>

canonical

<link rel="canonical" href="https://www.myawesomeapp.io" />

Contributing

I would love to see you contributing to use-seo, also by giving feedback. If you think something is missing, create a new issue.

Pull request are more than welcome ❤️️

License

MIT © aganglada

Contributors ✨

Thanks goes to these wonderful people (emoji key):

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

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago