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

Trailing slash support (given it's now default on Gatsby). #240

Open
emiliekmartinez opened this issue Feb 20, 2023 · 7 comments
Open

Trailing slash support (given it's now default on Gatsby). #240

emiliekmartinez opened this issue Feb 20, 2023 · 7 comments

Comments

@emiliekmartinez
Copy link

emiliekmartinez commented Feb 20, 2023

Welcome to the Gatsby Plugin Advanced Sitemap GitHub repo! 👋🎉

Issue Summary

As of Gatsby [email protected], trailing slashes are now the default. The sitemap should therefore also include these trailing slashes in the unique URLs. I think it'd also make sense to follow the pattern of adding a flag if someone wants to remove the trailing slash.

To Reproduce

Follow the instructions in the ReadMe.

Other info

E.g. all of these should have slash's at the end of them, but they don't.
image

Technical details:

  • Gatsby Version: 4.7+
  • Node Version:
  • OS:
  • gatsby-config.js:
{
      resolve: `gatsby-plugin-advanced-sitemap`,
      options: {
          query: `
          {
            allContentfulTwentyTwo {
              edges {
                node {
                  slug
                  id
                  updated_at: updatedAt
                  }
                }
              }
            }
            allContentfulTwentyTwoArticle {
              edges {
                node {
                  slug
                  id
                  updated_at: updatedAt
                  }
                }
              }
            }
          }`,
          mapping: {
            allContentfulTwentyTwoArticle: {
              sitemap: `posts`,
            },
            allContentfulTwentyTwo: {
              sitemap: `pages`,
            },
          },
          exclude: [
            `/dev-404-page`,
            `/404`,
            `/404.html`,
            `/offline-plugin-app-shell-fallback`
          ],
          createLinkInHead: true, // optional: create a link in the `<head>` of your site
          // addUncaughtPages: true, // optional: will fill up pages that are not caught by queries and mapping and list them under `sitemap-pages.xml`
      }
    },
@insaurabh
Copy link

Hi Team,

Getting the same issue.

@knnyczr
Copy link

knnyczr commented Mar 23, 2023

Commenting on this thread; also looking to get this resolved

@shashank-011bq
Copy link

Hello,

Getting This issue.
Please solve it on priority

@JuniPerla
Copy link

Hi! Also looking to have this resolved.

@shashank-011bq
Copy link

Had to Take matter in my hands.
Forked and Published this
https://www.npmjs.com/package/gatsby-plugin-advanced-sitemap-webrication

Please use this instead

@vczb
Copy link

vczb commented Jul 26, 2023

The same issue here, add and remove the trailing slash at the end should be configurable under options

@mordonez
Copy link

mordonez commented Oct 5, 2023

Same issue Here

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

No branches or pull requests

7 participants