How can I inject json-ld data into my route page?
This is the json I want to inject
1 Reply
If I understand the question, use a JSX
<script>
element and use the textContent
prop.
https://playground.solidjs.com/anonymous/47873fec-f47d-44d6-b2f0-05d1d29127ed
If you need it on the page layout level you could use it's RouteSectionProps
location
prop to map each route to a specific json-ld
document.
If you require collocation have the route page put it in a context so the page layout can pick it up.Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
GitHub
solid-router/src/types.ts at 3cd2fef67fe0b4d8bb3178923be32d541d56ec...
A universal router for Solid inspired by Ember and React Router - solidjs/solid-router