netlify-plugin-sitemap icon indicating copy to clipboard operation
netlify-plugin-sitemap copied to clipboard

netlify-plugin-sitemap doesn't generate a sitemap during manual deployment by netlify CLI

Open ybabenkoJapp opened this issue 2 years ago • 2 comments

Hi! I have noticed the netlify-plugin-sitemap doesn't generate a sitemap during manual deployment by netlify CLI. When the website is live I get not found. I deployed it in the netlify app and the sitemap was generated. Please help me to understand how to manage it.

To Reproduce

Steps to reproduce the behavior:

  1. Deploy it to Netlify

I use a such command to deploy the website:


     netlify deploy --site ****************  --auth *********************


netlify.toml 

[build]
  publish = "dist"

[[headers]]
  for = "/*"
  [headers.values]
    Accept-Encoding = "gzip, compress, br"

#Sitemap
[[plugins]]
  package = "@netlify/plugin-sitemap"

  [plugins.inputs]
    buildDir = "dist"
    filePath = "./sitemap.xml"


"dependencies": {
    "@netlify/plugin-sitemap": "^0.8.1",
}

  1. See that the sitemap file is missing after deployment.

I want to get a generated sitemap after manual deployment instead always going to the Netlify app and triggering the deploy

ybabenkoJapp avatar Jan 25 '23 14:01 ybabenkoJapp

Possibly related?

I just enabled the sitemap plugin via the Netlify UI. I manually deployed by uploading files. There is no sitemap generated at domain/sitemap.xml.

andrew-davis avatar Sep 06 '23 23:09 andrew-davis

@ybabenkoJapp You should also be running netlify build after your regular build process.

For me, it looks like this in my package.json file:

"scripts": {
    // ... other lines
    "deploy": "npm run build && netlify build && netlify deploy --dir=dist --prod"
}

neontomo avatar Apr 30 '24 10:04 neontomo