withastro / roadmap

Ideas, suggestions, and formal RFC proposals for the Astro project.
290 stars 29 forks source link

Sitemap for repo with 2 domains should offer an optional function to apply to the strings. #944

Closed disrae closed 1 month ago

disrae commented 2 months ago

Discussed in https://github.com/withastro/roadmap/discussions/941

Originally posted by **disrae** June 4, 2024 # Summary The Astro config does not have access to the slug, so the sitemap generator can only access one domain, there is no data to make the domain dynamic with. For repos with two domains it would be nice pass a function to the generator which is applied to the url strings as they are generated. # Background & Motivation For repos that implement two or more domains based on locale (my case), I need to be able to generate a sitemap that has the correct domain for each slug. For every slug that has '/en-us' in the string I want to switch out the domain. # Goals A lightweight, non-breaking change to give more custom control in the sitemap generation process. # Example I would simply want to add it in the options object for the sitemap generator.
Princesseuh commented 1 month ago

Please don't create issues yourself, we'll move discussions to stage 2 once they're ready.