Ernest Riccetto
Ernest Riccetto

Reputation: 53

Nuxt Seo meta-description

I'm following the documentation for seo of https://nuxtjs.org/docs/features/meta-tags-seo/ in a netifly hosted nuxt project wwww.estudiosclaw.com

the problem when i run the lighthouse checker in chrome it says the meta description is empty ( apeears in the head of the html ).

when i retieve a especific post directly all checks are red.

in google search typing "estudios claw" only appears the navbar titles.

I have set all my meta description individually depending the page.

example:

head() {
    return {
      title: `${this.about.data.attributes.title}`,
      meta: [
        {
          hid: "description",
          name: `${this.about.data.attributes.title} - Estudios Claw`,
          content: `${this.about.data.attributes.description}`,
        },
      ],
    };
  },

Upvotes: 1

Views: 1155

Answers (1)

Stephen Ostermiller
Stephen Ostermiller

Reputation: 25524

You need to generate a meta tag like <meta name=description content="This is the description of the page.">. Your code would not do that. The example code you linked to shows that both the hid and the name should be "description" (literally.) You appear to be putting the page title into the name attribute of the <meta> tag, which is not correct. Correct code should be more like:

head() {
    return {
      title: `${this.about.data.attributes.title} - Estudios Claw`,
      meta: [
        {
          hid: "description",
          name: "description",
          content: `${this.about.data.attributes.description}`,
        },
      ],
    };
  },

Upvotes: 1

Related Questions