Load and merge external sitemap.xml

ianfortier
0
ianfortier
commented 18 days ago

Is it possible to load an external site map and merge it with the one generated by the plugin?

eg: yyy.com/sitemap.xml

The items are loaded from this remote sitemap are merged with the one generated by the plugin.

Thanks

0
NicoPennec
1.4k
NicoPennec
commented 17 days ago

Yes, you can use the routes option with your own custom function that will load and parse your external xml file, then inject its values as custom routes to the sitemap module.

See routes option: https://github.com/nuxt-community/sitemap-module#function-which-returns-a-promise

See an example here (it used the filter option, but a similar approach): https://cmty.app/nuxt/sitemap-module/issues/c56

1
Informations
Question โ€ข Unresolved
#c59 - Created 18 days ago