Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When only linking to an external site map is configured, the multiple-sitemaps warning should be canceled #308

Closed
Red-Asuka opened this issue Jul 8, 2024 · 0 comments

Comments

@Red-Asuka
Copy link

My site uses i18n and is configured with an external link site map. There are no other multi-site map configurations besides this, but the terminal will prompt a warning.

[@nuxtjs/sitemap 17:14:57]  WARN  You are using multiple-sitemaps but have provided sitemap.sources in your Nuxt config. This will be ignored, please move it to the child sitemap config.

This is my current configuration:

const sitemap: NuxtConfig['sitemap'] = {
  defaults: {
    changefreq: 'weekly',
  },
  exclude: [
    ...excludeRoutes,
  ],
  urls,
  sitemaps: {
    index: externalSitemaps.map(sitemap => ({ sitemap })),
  },
}
image

I tried to modify it to a child sitemap, but this will merge the sitemaps of multiple languages into one. What is the best practice for this?

const sitemap: NuxtConfig['sitemap'] = {
  sitemaps: {
    pages: {
      defaults: {
        changefreq: 'weekly',
      },
      exclude: [
        ...excludeRoutes,
      ],
      urls,
    },
    // extending the index sitemap with an external sitemap
    index: externalSitemaps.map(sitemap => ({ sitemap })),
  },
}
image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant