@nuxt/sitemap dont's generating xml
Hi i'm triying to generate a sitemap with @nuxt js/sitemap coming from a external url. After add at the end of modules '@nuxt js/sitemap' I add this configuration in the nuxt.config.ts. But not seems to work.
sitemap: {
path: '/sitemap.xml',
hostname:process.env.HOST_NAME,
sources: ['https://strapi.walaxiadev.ovh/api/sitemap/generate'],
excludeAppSources: true,
defaults: {
changefreq: 'daily',
priority: 1,
lastmod: new Date()
}
},
If I go to the route /sitemap.xml I redirects to this page
Someone can help us?.
12 Replies
this is fine 👍
View the page source to see the raw XML
https://strapi.walaxiadev.ovh/api/sitemap/generate
This is the endpoint and i need to pass this to the plugin for transform this list of url in a xml.
How i can transform it and how can i check the final xml
In view-source it doesn't appears too.
If you see a sitemap.xml in the production site is uploaded by us manually. We are in the test site in local.
ohh, got it
Excuse me. I don't understand your answers.
the URL has a 502 for me
Excuse us. We activate pm2
works fine for me
be aware that it won't work in stackblitz if your sitemap URL does not allow CORS
settings:
Thanks. Ok i create a minimum reproduction in stackblitz and then i see what happen i18n is disabling sources any other configuration. I try it with and without excludeAppSources https://stackblitz.com/edit/nuxt-starter-dc1h21?file=nuxt.config.ts
Ivan
StackBlitz
Nuxt Sitemap - Dynamic URLs (forked) - StackBlitz
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
If that's not the right way can someone show me an example. please?
I create directly an endpoint in nuxt without Nuxt sitemap