Closed chichi13 closed 1 month ago
Unfortunately I don't think the chunking
functionality is currently supported when combined with custom urls
or sources
.
Okay this is what I was thinking.
I ended up doing it like this:
sitemap: {
cacheMaxAgeSeconds: 3600,
gzip: true,
exclude: ["/admin/**", "/auth/**"],
autoLastmod: true,
sitemaps: {
events: {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/events`,
],
},
streamers: {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/streamers`,
],
},
games: {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/games`,
],
},
"games-2": {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/games?page=2`,
],
},
"games-3": {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/games?page=3`,
],
},
"games-4": {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/games?page=4`,
],
},
"games-5": {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/games?page=5`,
],
},
"events-groups": {
sources: [
`${
process.env.API_BASE_URL || "http://localhost:8000"
}/api/v1/sitemap/events/groups`,
],
},
pages: {
includeAppSources: true,
},
},
},
Not a big fan because it's not dynamic. So if someone has a dynamic solution I'll take it :D
Glad you could find a workaround, you will need to wait for official support of https://github.com/nuxt-modules/sitemap/issues/265.
Will track in that issue.
đ What are you trying to do?
I have an i18n website with a lot of URLs, I'm about to pass the 50,000 URL mark. As you may know, Google limits the number of URLs per sitemap to 50,000. So I'd like to know how I can separate my sitemap into several? I looked at the documentation but couldn't get it to work. Here's the code I currently have:
As my URLs are the same between the different languages, the frontend divides the URL /fr, /es and / for English by default.
Currently my sitemap looks like this:
How can I get this kind of sitemap:
Or another solution?
đ What have you tried?
I've tried with
sitemaps: true
anddefaultSitemapsChunkSize
. I also tried with manual chunking but I couldn't do what I wanted to do.âšī¸ Additional context
My backend is a FastAPI (Python) backend, I can of course change the code if needed.