-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Head properties not updated on Pages #11
Comments
@Torone to make sure I understand what you are experiencing, I have a few questions:
Reason to "not set SEO via asyncData"The reason for the documentation stating to NOT set the SEO in asyncData for SSR is that the titles will not be updates as you navigate between the different pages on the Nuxt site. In this case the title is only updates upon initial load of the site. And will not change when navigating to another page. But if you refresh the browser on that new page, the title is updated Request you share your code?Based on your message, it sounds like you are experiencing the opposite though. Can you share your |
I am having same issues as well. The title of the page initially shows from the nuxt config and then gets overridden by the page head configuration, but the page source still keeps the title and description from the nuxt config, thus always showing the same title and description across all pages when I share links to social media sites.
home page:
createSEOMeta function
|
@sdevkota how are you setting specific titles on the page? Is it via Can you share your |
@nickfrosty I just updated my comment above with the code snippets. Sorry should've done it earlier. Not via |
@sdevkota in your home page code, you are returning a generic JSON object. In order to use the From inside the head method, you can either:
Also, the way you are using a separate function (the one you have named |
@nickfrosty I switched it to nuxt-seo and it is a great plugin. Same thing, I guess that might be because ssr:false, target:'static'? |
Using last Nuxt version 2.15.7.
The Pages configuration do not iverride the global configuration set in the
nuxt.config.js
file.When loading the page, for a very short time, I can see the global title on the browser tab, then it is updated with the right Page title.
Browsing the page source, the title, description and all other meta information are the ones set in globally. When sharing the pages to a social media it displays the global information and never the ones set in the Pages.
I see you wrote in the documentation:
Unfortunately, by setting the $seo using
asyncData
is the only way to get it right. So, why we shouldn't if it is the only way to have it working as expected?The text was updated successfully, but these errors were encountered: