I've generated a Nuxt website wuth yarn run generate.
From the index /, the title is updated when I go to another route. However when I reload the destination page, the title value becomes the one in /index.html.
Do you know how to avoid this behavior?
Plus, it seems I can't add a hid property to title with vue-meta. Does it mean it replaces the default one automatically?
Hi @lucpotage,
Can you post some code snippets to see how you change your title in the page component, please?
Sure, here is an example for one of my pages:
export default {
head: {
title: 'Lorem ipsum',
meta: [
{ hid: 'description', name: 'description', content: 'Lorem ipsum' },
{ hid: 'og:url', property: 'og:url', content: 'http://lorem-ipsum.com/lorem-ipsum' },
{ hid: 'og:title', property: 'og:title', content: 'Lorem ipsum | Acme' },
{ hid: 'og:description', property: 'og:description', content: 'Lorem ipsum' },
{ hid: 'twitter:title', property: 'twitter:title', content: 'Lorem ipsum | Acme' },
{ hid: 'twitter:description', property: 'twitter:description', content: 'Lorem ipsum' }
]
},
…
}
You should use name instead of hid for og and twitter.
Take a look on the nuxtjs website source code.
Does it mean the rule explained here is not applicable to all meta tags? In my case, my Twitter and Open Graph tags must also be replaced because they are different from the index.
In your source code, the properties are inside return { }. Is it recommended, like for Vue data property?
Why you close this issue? Can't believe it.
Dynamic meta tags still doesn't work on initial page load!
@lucpotage did you fix this?
@alexchopin you should reopen this topic, you answer is have nothing to do with the question.
Sorry, I found my error.
Hi there @hackuun
What was your error?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi there @hackuun
What was your error?