1.0.2 • Published 3 years ago

nuxtjs-seo-meta v1.0.2

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

nuxtjs-seo-meta

Support Nuxtjs generate SEO metadata

you can define seo metadata in different page

Install

yarn add nuxtjs-seo-meta

// or npm 
npm add nuxtjs-seo-meta

add config to nuxt.config.js

modules:[
  // ... your other modules
  ['nuxtjs-seo-meta',{
    defaultImage: 'https://fakeimg.pl/400x400/?text=DefaultImage',
    defaultUrl: 'https://facebook.com'
      // ... more options
  }]
]

use seoMeta method in nuxtjs context, general we can use at aysncData hooks

async asyncData({ seoMeta }) {
  seoMeta({
    title: "PageTitle",
    description: "PageDescription",
    url: "PageUrl",
    image: 'SocialShareImage.png'
  })
}

That all, you can inspect you page in chrome developer tools, here i just show demo screenshot

DemoImage

Options

Below options all effect html head meta tag

optionstypedescription
titlestringany thing you want to set to meta
descriptionstringany thing you want to set to meta
urlstringcurrent page url or other you want to share with others
defaultUrlstringdefault image when your page not present images
imagestringcurrent page share image url
defaultImagestringdefault current page share image url
localestringcurrent page locale, this option just present in og
siteNamestringyou web app name, this option just present in og
twitterUserstringyou can share page to twitter with creator user
ignoreTwitterbooleandisable twitter seo metadata
ignoreOGbooleandisable OG seo metadata