Dynamic `<head>`
Hi everyone
Is possible to put on
app.tsx
a dynamic <head>
tags (Title
, Meta
, ...)?
Basically I have all my content manage on a CMS, and I want to se the base title, the base meta tags fetching from CMS, but if I try to use createResource
on app.tsx
gives me an error.
Any suggestion3 Replies
Did you have a look at dynamic routes?
https://docs.solidjs.com/solid-start/building-your-application/routing#dynamic-routes
With dynamic routes you can match the „slugs“ or IDs of your cms and have title and meta tags set „dynamically“ by design.
Yes, but I don't want to set on a specific root
I want to set the default meta tags at the begining
If you’re using a head tag, remove that - you can’t have a head inside the body.
Just use Title component. Solid will place it in the document head.
There’s no issue using createResource in the app.