Sitemaps

Sitemaps are used to help search engines index your website.

Sitemaps

When you enable the seo option in the module configuration, the module will add the sitemap url /api/sitemap/urls to the sitemap config.

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nobears-front-end/nuxt-statamic'],
  statamic: {
    seo: true,
    // or with a custom sitemap path.
    seo: {
      sitemap: {
        path: "/sitemap.xml",
      },
    },
  },
});

This endpoint is a server route from the module to fetch the sitemap URLs. It will automatically fetch the sitemap URLs from the Statamic API and return them as a JSON response.

I18n

In order to correctly generate the sitemap, you will need to add the site key to your i18n.locales objects. This also requires that you generate the sitemap for each site in the Statamic CMS. Each generated sitemap should end with the site handle.

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nobears-front-end/nuxt-statamic'],
  i18n: {
    locales: [{
      code: 'nl-NL',
      site: 'tenant-nl-NL', // Should be the statamic site handle.
    }],
  },
});