Netlify sitemap plugin & exclude pages

Have checked tones of similar articles on this forum, but nothing works.

Task is simple, exclude some pre-defined pages from sitemap page which is generated based on toml file.

Here is my complete toml file contents:

 [[plugins]]
        package = '@netlify/plugin-sitemap'
          [plugins.inputs]
          buildDir = "dist"
          exclude = [
            './404',
            './404.html',
            './404/index.html',
            './success',
            './success.html',
            './success/index.html'
          ]

I’m using astro.build and dist folder looks like this:

/dist/404.html
/dist/success/index.html

based on github doc: GitHub - netlify-labs/netlify-plugin-sitemap: Automatically Generate sitemaps on build

to exclude file I need to write:

'./404.html',
'./success/index.html'

but as you can see from variations from above - nothing works, I still see these pages in my sitemap file:

<url>
<loc>https://website.com/404</loc>
<lastmod>2024-04-22T11:33:47Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>

<url>
<loc>https://website.com/success</loc>
<lastmod>2024-04-22T11:33:47Z</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>

What I’m doing wrong?
Thank you in advance for the help

@GhostBob I’m not sure if this is the case, having never used it, but have you tried:

exclude = [
  './dist/404',
  './dist/404.html',
  './dist/404/index.html',
  './dist/success',
  './dist/success.html',
  './dist/success/index.html'
]

The documentation isn’t super clear, but it does mention:

[plugins.inputs]
buildDir = "public"
exclude = [
  # By file Path
  './build-dir/path-to/file.html',

@nathanmartin Thank you very much. It helped :slight_smile:

glad to hear you found a solution! :rocket: