Skip to main content
GitHub
1 min read

Plugins

Sitemap Plugin

Auto-generate sitemap.xml for search engines

The sitemap plugin generates a sitemap.xml file at build time, helping search engines discover and index your documentation pages.

Installation

pnpm add @barodoc/plugin-sitemap@latest

Configuration

{
  "plugins": [
    ["@barodoc/plugin-sitemap", {
      "exclude": ["/404", "/api/*"],
      "customPages": ["https://docs.example.com/changelog"]
    }]
  ]
}

The sitemap is generated at sitemap-index.xml and sitemap-0.xml in the build output. Make sure to set the site option in your config for absolute URLs:

{
  "site": "https://docs.example.com",
  "plugins": ["@barodoc/plugin-sitemap"]
}

Options

excludestring[]

Glob patterns for pages to exclude from the sitemap

customPagesstring[]

Additional full URLs to include in the sitemap