TryGhost / gatsby-plugin-advanced-sitemap

Advanced XML Sitemaps for Gatsby.js
MIT License
150 stars 0 forks source link

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

Open emiliekmartinez opened 1 year ago

emiliekmartinez commented 1 year ago

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

Issue Summary

As of Gatsby gatsby@4.7.0, 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:

{
      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 commented 1 year ago

Hi Team,

Getting the same issue.

knnyczr commented 1 year ago

Commenting on this thread; also looking to get this resolved

shashank-011bq commented 1 year ago

Hello,

Getting This issue. Please solve it on priority

JuniPerla commented 1 year ago

Hi! Also looking to have this resolved.

shashank-011bq commented 1 year ago

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 commented 1 year ago

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

mordonez commented 1 year ago

Same issue Here