Skip to content
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

[Feature request] Microdata/JSON-LD Support #6

Open
andreacanton opened this issue Jun 25, 2020 · 7 comments
Open

[Feature request] Microdata/JSON-LD Support #6

andreacanton opened this issue Jun 25, 2020 · 7 comments

Comments

@andreacanton
Copy link
Contributor

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

@lorisleiva
Copy link
Owner

Hi there 👋

Good idea.

The challenge for me here was to find a flexible API to provide that JSON schema.

PR welcome. 🙂

@adamdehaven
Copy link

@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?

@lorisleiva
Copy link
Owner

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.

@adamdehaven
Copy link

Right, but you can't inject a script tag as part of the page meta or frontmatter, so... How would you do that?

@lorisleiva
Copy link
Owner

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.

Screenshot 2020-08-15 at 18 20 36

@adamdehaven
Copy link

@lorisleiva when you pass values there, they don't update on route change though ...

@amerkay
Copy link
Contributor

amerkay commented Oct 31, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants