Sitemap
What's the preferred way to create a dynamic sitemap in TSS? Was thinking of an API route but it seems a bit quirky to get those to work from the root of the domain.
8 Replies
wee-brown•8mo ago
Try this and let me know if it fits the bill
wee-brown•8mo ago
npm
vite-plugin-tanstack-router-sitemap
Vite plugin to generate sitemaps from TanStack Router route trees. Latest version: 1.1.0, last published: 4 days ago. Start using vite-plugin-tanstack-router-sitemap in your project by running
npm i vite-plugin-tanstack-router-sitemap
. There are no other projects in the npm registry using vite-plugin-tanstack-router-sitemap.absent-sapphireOP•8mo ago
Can't seem to see how it'd let me generate records for dynamic pages, eg /blog/$slug for each of my blog entries in the db
wee-brown•8mo ago
Yeah, that’s an issue
Maybe this needs to become an official api or something
absent-sapphireOP•8mo ago
Would love to see that. Do you have any temporary workaround in mind until then? I could generate it using a script at build-time and just put it in the public folder for now.
Found this: https://discord.com/channels/719702312431386674/1240861643462934568/threads/1328791185858498570 - I'll stick to that for now, but a better first-hand api for defining this would be great in the future
wee-brown•8mo ago
Yeah. I'd like to see what you did while I think on a better approach.
stormy-gold•8mo ago
Hey @Lars I built a package to generate sitemaps with dynamic routes
https://discord.com/channels/719702312431386674/1238170697650405547/1332919518183292989
absent-sapphireOP•8mo ago
That's cool, I'll give it a spin!