Nuxtjs Generate SEO metadata simple

ihavecoke

mixbo

Posted on January 2, 2021

Nuxtjs Generate SEO metadata simple

when you use nuxtjs to support ssr, you can defined meta info in page vue component. and you should set metadata each page?

No! you can just add nuxt-seo-meta to your project.

i have made this npm to reduce time defined redundancy meta.

in nuxt-seo-meta you just defined you care info and reset all meta info nuxt-seo-meta will auto generate.
include twitter, facebook social meta.

here show the screenshoot for you

use in asyncData

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

use in head

head({$seoMeta}){
  return {
   meta: $seoMeta({...options}, false)
  }
}

Enter fullscreen mode Exit fullscreen mode

DemoImage

you can find more info here

πŸ’– πŸ’ͺ πŸ™… 🚩
ihavecoke
mixbo

Posted on January 2, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related