Auto creating sitemap and index files from one large list?

PTiCA1
0
PTiCA1
commented 3 months ago

What problem does this feature solve?

Hello to everybody,
does anyone have a solution to solve sitemap generation for a large number of pages? I generate articles from wordpress rest api and I need to split the sitemap into more files.

There is a solution in the sitemap.js documentation but I don't know how to use it in nuxt.js
https://github.com/ekalinin/sitemap.js#building-just-the-sitemap-index-file

Thanks for any advice.

idea
0
AndyCosow
10
AndyCosow
commented 3 months ago

Hi there, i was dealing with the similar problem - i made single sitemap with this module, there was little bit less than 50k links, so when provided that sitemap to google search console, they failed to fetch it.

My solution was to build sitemap index and put all the sub sitemaps in to it - i took all links from my old sitemap and divided them in categories. All this was done with sitemap.js in node.js using express router to send back response as generated sitemap.xml index file.

1
roryheaney
5
roryheaney
commented 2 months ago

@AndyCosow did you have example code for that available?

1
NicoPennec
1.7k
NicoPennec
commented 2 months ago

@PTiCA1 the "sitemap index" feature is WIP (see #6), but without limit size for now ๐Ÿ˜•

After a quick review, it seems that we can't use the createSitemapIndex function from sitemap.js you're quoting, because the sitemap-module dynamically returns the sitemaps and won't be able to write to a folder as the feature proposes.

When the new version of the sitemap module with sitemapindex will be published (and stable ^^). We can start developing your feature. It will be an useful enhance ๐Ÿ‘

1
AndyCosow
10
AndyCosow
commented 2 months ago

@roryheaney yes, here it is - On CodePile

I also recommend you to look in to sitemap.js documentation everything is pretty clear out there :)

1
ricardogobbosouza
928
ricardogobbosouza
commented a month ago

@PTiCA1 This feature exists in v2.0.0
@NicoPennec can closed?

0
NicoPennec
1.7k
NicoPennec
commented a month ago

@ricardogobbosouza nope! the v2.0.0 add only a manual splitting. The auto splitting is planned for the next release (see milestone). I started working on it (but not published yet)

0
Informations
Feature Request โ€ข Open
#c62 - Created 3 months ago