Open andreacanton opened 4 years ago
Hi there 👋
Good idea.
The challenge for me here was to find a flexible API to provide that JSON schema.
PR welcome. 🙂
@lorisleiva I can help with this, but a question: how would you inject the structured data into the rendered page, without JavaScript so that it's available on page load?
Vuepress compiles for both server-side rendering and client-side rendering. So, just like we do with the current metadata, we just need to make sure it's applied when compiling the initial HTML pages.
Right, but you can't inject a script tag as part of the page meta or frontmatter, so... How would you do that?
I'm hoping the innerHTML
argument could do the trick but otherwise, we'd have to manually inject it somehow by looking into how that head
configuration work on the Vuepress core.
@lorisleiva when you pass values there, they don't update on route change though ...
Check out this article about adding Canonical, Meta Tags, and Structured Data.
We should implement for VuePress v2. I already submitted a pull request with upgraded code to v2.
Hi!
I think it should be supported the Microdata/JSON-LD.
More info about this structured data here:
https://developers.google.com/search/docs/guides/intro-structured-data?hl=en