Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Add sitemapSiteUrl Field to Facilitate Sitemap Index Generation with External Hosting #789

Open
moonrailgun opened this issue Mar 25, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@moonrailgun
Copy link

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

Currently, our system generates sitemap indexes that assume the sitemap XML files are hosted within the same domain as the application. However, in cases where the main sitemap XML content is deployed on a different site, managing and linking these external sitemaps becomes cumbersome and error-prone.

For example, we have a huge sitemap(more than 100k record), we dont wanna manage it in major repo, and also dont transport it with any backend(because file is too large). so a static file which host sitemap with s3(maybe others) is a best solution.

but we also wanna keep major sitemap in main repo(domain).

Describe the solution you'd like

We need to introduce a new field named sitemapSiteUrl in our configuration. This addition is aimed at enhancing the generation and management of sitemap indexes, especially when the main sitemap XML is hosted externally.

Introduce a sitemapSiteUrl field which will allow users to specify the base URL where the main sitemap XML is hosted. This field will be used to prepend the correct site URL to the sitemap entries in the index, thus facilitating proper linking and management.

Now generate file should looks like those:

sitemap.xml:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://sitemap.exmaple.com/sitemap-0.xml</loc></sitemap>
</sitemapindex>

sitemap-0.xml:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://exmaple.com/xxxxxx</loc><lastmod>2024-03-25T03:32:54.391Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
</urlset>

Describe alternatives you've considered

Here is my patches:

image

and git ignore file:

image

Additional context

If you think its a good idea, i can create a PR for that

@moonrailgun moonrailgun added the enhancement New feature or request label Mar 25, 2024
Copy link

Closing this issue due to inactivity.

@moonrailgun
Copy link
Author

moonrailgun commented May 24, 2024

Closing this issue due to inactivity.

👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants