Open fbritoferreira opened 1 year ago
Cant we use a vite plugin here?
Tried using https://github.com/jbaubree/vite-plugin-sitemap
but it seems like it wont work out of the box for the sitemap config, we need a way for it to undestand the routes in solid
Hmm this is interesting because we support a combination of file system and runtime routes. I'm not sure if we can get that information easily at build time.
@ryansolid For non dynamic routes we could possible get it at build time, for dynamic routes I guess we could provide some kind of pre-defined to use but there isn't much it can be done?
For my current project it was quite easy to generate the sitemap.xml at build time. My site is static only, route prerendering could work differently for other nitro presets or dynamic routes.
@ryansolid Something like this could be added to the docs or a starter template?
Relevant changes are the prerender
config and the sitemap.xml.ts
route.
https://github.com/edelms/spfx-x/blob/main/docs/app.config.ts
https://github.com/edelms/spfx-x/blob/main/docs/src/routes/sitemap.xml.ts
We should be able to generate the sitemap.xml file as part of the build process.
Fresh-seo does something similar for the fresh framework https://github.com/xstevenyung/fresh-seo
But this could be integrated into the app maybe as I opt in if people are only building a SPA