fedeya / remix-sitemap

Sitemap generator for Remix applications
https://npmjs.com/remix-sitemap
MIT License
95 stars 5 forks source link

Runtime generation splitting sitemaps #71

Open danthegoodman1 opened 3 weeks ago

danthegoodman1 commented 3 weeks ago

Is your feature request related to a problem? Please describe. Google limits to 50MB, or 50k URLs. If a site has more than that with runtime generation, then either limits will have to be enforced, or google will not index.

Describe the solution you'd like Allow for dynamic endpoints to have their own split sitemap. So if dynamic is used, all dynamic urls live in their own sitemap for that route.

A single dynamic route can be further split if a splitFunc is provided which would return an int that tells the sitemap generator which split to put it in.

This could definitely use a lot of memory.

Describe alternatives you've considered adding a manual sitemap generation function to an endpoint like in https://github.com/danthegoodman1/SellMyAI/blob/main/src/remix/routes/sitemap%5B.%5Dxml.ts and https://github.com/danthegoodman1/SellMyAI/blob/main/src/remix/routes/sitemap-repos%5B.%5Dxml.ts

danthegoodman1 commented 3 weeks ago

keyset pagination makes this comparatively easy at massive scales

the generator can just ask for the next N pages and auto-split as needed. As long as the name of the split is named after the first key in the list, it's easy to pick up where it left off