Sitemap Plugin - Where is the Sitemap Generated?

Hey @clarnx I read through this forum and clicked the link you provided. I primarily want to use Netlify’s plugin since it automatically updates the sitemap. Our site has been deployed properly through Github, changes are updated automatically without issue in Netlify. Following your instructions after installing the plugin, my entire netlify yoml file has the following:

[build]
command = “npm run build”
publish = “build/”
functions = “functions/”
[[plugins]]
package = “@netlify/plugin-sitemap”
[plugins.inputs]
buildDir = “.”

However a sitemap does not generate at the following URL:
https://www.add3.io/sitemap.xml

I’ve installed the plugin via your UI not the cmd line. What would you recommend?

Update So I got the sitemap to generate by changing my buildDir to =“build”. But the XML is empty, perhaps because svelte files are well… svelte files and not .html?
Either way, I don’t think Netlify’s plugin is meant to be user friendly, my recommendation is to have an interface that asks for the framework a user is using and adapt the plugin that way. I will attempt to use a different dependency built for the framework i’m using like svelte-sitemap on NPM.

You’ll want to change the buildDir to the same value as the publish directory set via publish @valentino. See full documentation

1 Like

@jasiqli I didn’t code the site, but it’s built on svelte, the publish directory could therefore be either “build” or “public”. Not sure where to look. However it is odd, because according to the documentation it should inherit the site build setting on its own.
Do you know if the default path is sitename.topdomain/sitemap.xml ?
Also how long does it typically take to generate the sitemap?

Because so far nothing happened after pushing “public” as the buildDir, Netlify recognized the change 10 minutes ago.

Is the Svelte site generating static files with a .html extension? My guess (without seeing the project) is probably not (based on past encounters.)

There is a sveltekit-sitemap plugin and documentation on the SvelteKit site regarding sitemaps. These are quite possibly more appropriate options for the project.

From memory, it is done as part of the build.


my static folder looks like this, however the code is svelte not sveltekit (just realized there’s a difference). So “public” should be the correct path for buildDir (which I had updated and the issue persisted).

A screenshot provides no useful information. A link to a repository would provide useful information.

it’s a private repo unfortunately :frowning: I can only share some elements