Search code examples
docusaurus

Where do I control sitemap for Docusarus?


I've checked docusurus.config.js and I can not see that sitemap plugin is installed but sitemap.xml exists in build directory.

What defines parameters how is sitemap generated?


Solution

  • As per the documentation of the docusaurus:

    If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.

    You can configure it like this

    module.exports = {
      presets: [
        [
          '@docusaurus/preset-classic',
          {
            sitemap: {
              changefreq: 'weekly',
              priority: 0.5,
              ignorePatterns: ['/tags/**'],
              filename: 'sitemap.xml',
            },
          },
        ],
      ],
    };
    

    Check this reference for more info.