N
Nuxt2y ago
Tobija

Statically Generating dynamic Meta Data despite using ssr: false

I'm using static site generation in combination with ssr: false. When I generate my nuxt 3 website, the meta data I add to the head in my config.nuxt.ts gets written in the statically generated html files. But everything I add inside my pages (either through the useHead composable or the Nuxt <Head> component) will not be generated in the static html files. Even though different index.html files are generated for the given pages. I suspect that using ssr: true would probably change this, but that comes with quite a lot of other changes I would need to make to my code. Is there any other way to get static meta data (e.g. open graph data) in my spa?
3 Replies
harlan
harlan2y ago
you basically need to spin up a server, render each route, take a snapshot and replace the html with that it's not something nuxt supports out of the box Netlify has an option to do this though
harlan
harlan2y ago
No description
harlan
harlan2y ago
you can use hooks but it gets quite hacky
Want results from more Discord servers?
Add your server