You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, there is no documented way to programmatically change or add head tags to the page at build time, that i'm aware of. I know that i can add head tags in the config or via frontmatter, but in some cases that is not sufficient. For example, when i want to add head tags based on existing meta data, like generating an og:image based on frontmatter (gatsby-remark-twitter-cards is an example in react land).
Describe the solution you'd like
A clean API to programmatically change or add head tags, prior to SSG.
Describe alternatives you've considered
Obviously i could dynamically add head tags to the page, but for some tags that is not a viable solution. For example, social media sites usually don't execute JS on the page, so any dynamically added Open Graph tags will not be considered.
Another option would be hacking something together around rollup's transform hook, but i would rather use a more dedicated vitepress API directly.
Additional context
Maybe i'm missing something here and this is already possible - then please point me in the right direction.
The social media tags were added to Frontmatter for the VitePress website, but they don't appear to be applying (either on the VitePress site or mine) and don't appear to be documented. Is that a bug?
Is your feature request related to a problem? Please describe.
Currently, there is no documented way to programmatically change or add
head
tags to the page at build time, that i'm aware of. I know that i can addhead
tags in the config or viafrontmatter
, but in some cases that is not sufficient. For example, when i want to add head tags based on existing meta data, like generating anog:image
based onfrontmatter
(gatsby-remark-twitter-cards is an example in react land).Describe the solution you'd like
A clean API to programmatically change or add
head
tags, prior to SSG.Describe alternatives you've considered
Obviously i could dynamically add
head
tags to the page, but for some tags that is not a viable solution. For example, social media sites usually don't execute JS on the page, so any dynamically added Open Graph tags will not be considered.Another option would be hacking something together around rollup's transform hook, but i would rather use a more dedicated vitepress API directly.
Additional context
Maybe i'm missing something here and this is already possible - then please point me in the right direction.
Validations
The text was updated successfully, but these errors were encountered: