-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Overriding global meta description #112
Comments
In fact, at current build flow, the description will be gennerated twice: I also realized this problem, and description meta tag has been handled at #48, I thought I'd open a PR to fix it alone, but because the multiple language support would also change it for different locale, I just added a patch(961cf2d) and fixed your problem quickly. |
After @ulivz's fix the generated static files should all have correct meta. Currently during dev or after a dynamic navigation it will still have duplicated description, but for SEO purposes that probably doesn't matter. |
Closed via #48 |
Thanks for your awesome support! ❤️ |
It seems that this bug is still there. I get the global and the page-specific decription on my pages. This is very bad for SEO. 🙁 <meta name="description" content="From global">
<meta name="description" content="From page"> |
@awulkan Please create an issue with the correct reproduction link 🙂 |
If I define a meta-description (frontmatter) in a page, it does not seem to override the meta-description defined in
.vuepress/config.js
.vuepress/config.js
Example page
I would expect that
my custom meta description
is rendered, but the default description from.vuepress/config.js
and the frontmatter-description are rendered.These are the code parts that seem to be responsible for the page-meta processing:
vuepress/lib/prepare.js
Line 76 in 1bbfa43
vuepress/lib/build.js
Line 131 in 1bbfa43
vuepress/lib/build.js
Line 153 in 1bbfa43
I'm not sure how to tackle this issue... maybe we could inject the global description into the
page.frontmatter.meta
object instead of thesiteConfig.head
object? Something like this:The text was updated successfully, but these errors were encountered: