Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sitemap Not Available #34

Closed
ethanosullivan opened this issue Nov 5, 2020 · 17 comments · Fixed by #41
Closed

Sitemap Not Available #34

ethanosullivan opened this issue Nov 5, 2020 · 17 comments · Fixed by #41

Comments

@ethanosullivan
Copy link

I had an issue with my Sitemap with the recent update. It used to work before with my configuration in my netlify.toml.

When I tried to visit my sitemap, I would end up with a 404 page. Previously, I did not define the buildDir in the past because the default value worked for me. After reading issue #33, I set my buildDir to "./" and that loads my sitemap. However, it's blank.

I changed it to buildDir = "publish" like the documentation, but I get the 404 again.

Here's my config:

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

[plugins.inputs]
buildDir = "publish"
prettyURLs = true
trailingSlash = true
exclude = [
    "**/404.html"
]

Please let me know the default buildDir to use. I have my repo hosted on GitHub, but it's private.

@erezrokah
Copy link
Contributor

Hi @ethanosullivan, where the html files for your site are located? Can you share the repo structure?

@ethanosullivan
Copy link
Author

In the root of my GitHub repo, here's what it looks like:

image

@ethanosullivan
Copy link
Author

Hey @erezrokah - just checking in on an update on this issue. I tried searching on Netlify what the correct buildDir should be, but I haven't found anything as of yet.

@erezrokah
Copy link
Contributor

Sorry @ethanosullivan, missed your last comment. buildDir should point to the directory where your static HTML files are located. In your case I would try buildDir: "."

@ethanosullivan
Copy link
Author

That seems to work. However, the <loc> tags are only showing my domain and not the full path to the URL. Here's what it looks like:

...
    <url>
        <loc>https://ethanosullivan.com/</loc>
        <lastmod>2020-11-09T14:01:05Z</lastmod>
        <changefreq>weekly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://ethanosullivan.com/</loc>
        <lastmod>2020-11-09T14:01:05Z</lastmod>
        <changefreq>weekly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://ethanosullivan.com/</loc>
        <lastmod>2020-11-09T14:01:05Z</lastmod>
        <changefreq>weekly</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>https://ethanosullivan.com/</loc>
        <lastmod>2020-11-09T14:01:05Z</lastmod>
        <changefreq>weekly</changefreq>
        <priority>0.8</priority>
    </url>
...

I do have 4 pages for my website, but you can see that it only shows the path as https://ethanosullivan.com/

@ethanosullivan
Copy link
Author

Did you get a chance to see my last comment @erezrokah ?

@ethanosullivan
Copy link
Author

Checking in again @erezrokah - any updates? This is broken on all of my sites that use this plugin

@erezrokah
Copy link
Contributor

Sorry for the late reply @ethanosullivan.
Do you mind sharing a public repo reproducing this issue? It will make it easier to debug

@ethanosullivan
Copy link
Author

Here you go @erezrokah:

https://github.com/ethanosullivan/example.com

I added a dummy website with plenty of pages and the sitemap plugin. You'll ee the results are the same.

@ethanosullivan
Copy link
Author

While you're testing out my test repo, is there a way to run the plugin on a previous version that is working? I activate the plugin through the netlify.toml file and don't use any CLI to run my websites.

@erezrokah
Copy link
Contributor

Hi @ethanosullivan, you can always install a specific plugin version via npm install @netlify/plugin-sitemap@<version> (e.g. npm install @netlify/plugin-sitemap@v0.4.0).

@ethanosullivan
Copy link
Author

That requires commands (CLI) - there's no other way? How's the progress going with finding a solution?

This was referenced Dec 8, 2020
@erezrokah
Copy link
Contributor

Hi @ethanosullivan sorry for the delay, this should be fixed by #41

@ethanosullivan
Copy link
Author

I republished my website with the following setitngs, but I still get the same issue:

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

[plugins.inputs]
buildDir = "."
prettyURLs = true
trailingSlash = true
exclude = [
    "**/404.html"
]

Is there a specific value I should use for the buildDir?

@erezrokah
Copy link
Contributor

I republished my website with the following setitngs, but I still get the same issue:

Hi @ethanosullivan, there is a time gap (which we are working to fix) between publishing a new plugin version until it is available in our CI. I'll update this issue once the new version is available.

@erezrokah
Copy link
Contributor

Hi @ethanosullivan, this should be fixed. Do you mind re-testing? buildDir = "." should stay the same

@ethanosullivan
Copy link
Author

I checked all of my websites after redeplying them. I see the sitemap is working again, thanks.

Just as a heads up, the README should be updated. It's showing up as buildDir = "public" and it should default to the root directory if that hasn't been implemented already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants