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

Support automatic chunking for multi-sitemap sources #265

Open
lxccc812 opened this issue Apr 12, 2024 · 9 comments
Open

Support automatic chunking for multi-sitemap sources #265

lxccc812 opened this issue Apr 12, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@lxccc812
Copy link

lxccc812 commented Apr 12, 2024

First of all, thank you for your outstanding contribution.

I have a website with a large number of URLs, about 5,000. I use sitemaps: true to solve the pagination problem. Most of the time, he was able to address my needs. But when I use this method managing-sources, he will not paginate for me, no matter how many URLs there are, and The sitemaps:true functionality is missing.

When I have two sources of data in different categories, I want to be able to distinguish them. For example, I have the following source

sitemap: {
    xsl: false,
    sitemaps: {
        posts: {
            sources: [
                ['/api/food', { headers: { accept: 'application/json' } }],
                ['/api/car', { headers: { accept: 'application/json' } }],
                // and more...
            ],
        },
    },
    excludeAppSources: ['nuxt:pages'],
    cacheMaxAgeSeconds: 60 * 60 * 24, // 1 day
},

I hope to generate the following sitemap

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <script />
    <sitemap>
        <loc>http://localhost:3000/food-sitemap.xml</loc>
        <lastmod>2024-04-12T09:02:56Z</lastmod>
    </sitemap>
    <sitemap>
        <loc>http://localhost:3000/car-sitemap.xml</loc>
        <lastmod>2024-04-12T09:02:56Z</lastmod>
    </sitemap>
</sitemapindex>

Moreover, if there is too much data under http://localhost:3000/food-sitemap.xml, you can use sitemaps:true to paginate again.

@harlan-zw
Copy link
Collaborator

Thanks for the feature suggestion, I agree support for paginated named sitemaps is needed.

I don't currently have capacity to attempt this but will revisit when possible.

@harlan-zw harlan-zw added the enhancement New feature or request label Apr 24, 2024
@harlan-zw
Copy link
Collaborator

@harlan-zw harlan-zw changed the title [Feature Request] Perform paging processing under multiple sources Support automatic chunking for multi-sitemap sources Jul 21, 2024
@censujiang
Copy link

same problem

@censujiang
Copy link

For example, enabling sitemapsChunk:true in the code is a flag to turn on this feature

  sitemap: {
    sitemaps: {
      urls:{
        sources: [
          `/api/__sitemap__/urls`,
         sitemapsChunk:true
        ],
      }
    },

I think it is best way to support it. Do you have any idea? @harlan-zw

@harlan-zw
Copy link
Collaborator

Yes, I'm open to supporting this it's just a bit complicated and haven't had a chance to tackle it. The configuration will likely be on the sitemaps key (or just re-use the existing config).

@jesspinklet
Copy link

I would love to see support for the feature as well. Also, its common as well for large URL websites

@Kerimhan05
Copy link

Hello

Faced the same problem, is there a solution to this problem or is it still relevant?

@harlan-zw
Copy link
Collaborator

It's planned but is complicated and low priority for me at the moment.

PRs welcome.

@censujiang
Copy link

It's planned but is complicated and low priority for me at the moment.

PRs welcome.

Although this demand is more urgent for large websites, it is very niche for most people. Maybe we need to wait for a destined person🤣

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

5 participants