Generate sitemap when API data changes?

hackuun
96
hackuun
commented 2 years ago

Is it possible to regenerate sitemap if I change my API data without rerunning npm run build?

I mean, Nuxt by itself doesn't need to rebuild everytime I add/change article. It just fetch new data.
Can this be done with this sitemap module?

0
TomFrajer
0
TomFrajer
commented 2 years ago

Check readme and look for: Function which returns a Promise

Is it what you are looking for?

0
hackuun
96
hackuun
commented 2 years ago

@TomFrajer axios is already returns a promise. I am not sure I am following what do you mean.

0
NicoPennec
1.7k
NicoPennec
commented 2 years ago

The sitemap-module have a cache of 15 minutes (by default) : https://github.com/nuxt-community/sitemap-module#cachetime

Then the sitemap.xml will be rebuild on next call.

0
Informations
Question โ€ข Unresolved
#c9 - Created 2 years ago