DEV Community

Cover image for Nuxtjs Generate SEO metadata simple
mixbo
mixbo

Posted on • Edited on

1

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay