next-sitemap icon indicating copy to clipboard operation
next-sitemap copied to clipboard

Server side rendered sitemap with dynamic siteUrl

Open jasonmit opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

The issue is I have a docker container that we build once and deploy to many different environments, which have different domains.

next-sitemap seems to want the siteUrl up front, so that it can create the sitemap at build time. In order to support this, the sitemap and sitemap index would need to be moved to the server - which appears to be loosely supported but not to the degree needed.

Describe the solution you'd like A solution would be to allow for the siteUrl to be state passed into the method call to generate the sitemap(s). Currently, it doesn't appear like that's a supported use-case and the sitemap generator only allows for additional fields.

Describe alternatives you've considered Another option would be to generate all the sitemaps at build time and implement the server-side sitemap index logic to choose the correct, prebuilt, sitemap. Not ideal, but could be a work around.

jasonmit avatar Aug 04 '22 19:08 jasonmit