Thanks for the excellent debugging here, @clarnx . Glad everything is working now, @CitrineDragon-- happy building
Hi @clarnx @CitrineDragon
I have the same problem installing my Sitemap to my google search console and Yandex, I followed all the step, but still don’t work, I also installed some sitemap plugin but doesn’t work can I have help thanks
Hi @maroc.yes.1993,
If possible can you share your repository for me to help with the debugging.
Thanks.
Here’s what worked for me:
- Deploy your site through Netlify via GitHub (very easy following the article that @clarnx linked in a previous reply.)
- Install the sitemap plugin in Netlify created by NetlifyLabs
- Verify that your sitemap has generated by adding /sitemap.xml to your site url.
- Copy that url into Google Console and it should work.
- If you still get an error in Google Console add another / to the end of your url /sitemap.xml/
thanks for your reply @clarnx
this is my repository : https://github.com/Mohammedeljaoui/mohammed
Thanks
I believe those settings will work. After you deploy the site, are you able to see the sitemap?
Post the url to the site, once it’s been deployed.
Hello @maroc.yes.1993, You can leave the settings blank and just continue with the deployment.
It should work as expected.
Hi @maroc.yes.1993, thanks for the feedback.
Kindly try the solution in the related post below to see if it helps.
Thanks.
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
@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 I can only share some elements