{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/9971","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/9971/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/9971/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/9971/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/9971","id":381531026,"node_id":"MDU6SXNzdWUzODE1MzEwMjY=","number":9971,"title":"double forward slashes in sitemap: gatsby-plugin-sitemap","user":{"login":"paulisloud","id":1498200,"node_id":"MDQ6VXNlcjE0OTgyMDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1498200?v=4","gravatar_id":"","url":"https://api.github.com/users/paulisloud","html_url":"https://github.com/paulisloud","followers_url":"https://api.github.com/users/paulisloud/followers","following_url":"https://api.github.com/users/paulisloud/following{/other_user}","gists_url":"https://api.github.com/users/paulisloud/gists{/gist_id}","starred_url":"https://api.github.com/users/paulisloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulisloud/subscriptions","organizations_url":"https://api.github.com/users/paulisloud/orgs","repos_url":"https://api.github.com/users/paulisloud/repos","events_url":"https://api.github.com/users/paulisloud/events{/privacy}","received_events_url":"https://api.github.com/users/paulisloud/received_events","type":"User","site_admin":false},"labels":[{"id":214544677,"node_id":"MDU6TGFiZWwyMTQ1NDQ2Nzc=","url":"https://api.github.com/repos/gatsbyjs/gatsby/labels/type:%20question%20or%20discussion","name":"type: question or discussion","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-16T10:06:45Z","updated_at":"2018-11-16T15:43:54Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I am using gatsby-plugin-sitemap on my Gatsby site, and when I review the URLs generated by the sitemap, each has a double forward slash at the end of the TLD. For example:\r\n\r\n```\r\n<url>\r\n<loc>https://www.website.com//about/</loc>\r\n<changefreq>daily</changefreq>\r\n<priority>0.7</priority>\r\n</url>\r\n```\r\n\r\nI suppose this is due to the `pathPrefix` being applied to the `urljoin` funciton in `gatsby-config.js`, however based on my testing a `pathPrefix` of `\"\"` is not allowed.\r\n\r\nWhat is the proper incantation here?"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/439433952","html_url":"https://github.com/gatsbyjs/gatsby/issues/9971#issuecomment-439433952","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/9971","id":439433952,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTQzMzk1Mg==","user":{"login":"paulisloud","id":1498200,"node_id":"MDQ6VXNlcjE0OTgyMDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1498200?v=4","gravatar_id":"","url":"https://api.github.com/users/paulisloud","html_url":"https://github.com/paulisloud","followers_url":"https://api.github.com/users/paulisloud/followers","following_url":"https://api.github.com/users/paulisloud/following{/other_user}","gists_url":"https://api.github.com/users/paulisloud/gists{/gist_id}","starred_url":"https://api.github.com/users/paulisloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulisloud/subscriptions","organizations_url":"https://api.github.com/users/paulisloud/orgs","repos_url":"https://api.github.com/users/paulisloud/repos","events_url":"https://api.github.com/users/paulisloud/events{/privacy}","received_events_url":"https://api.github.com/users/paulisloud/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T15:43:54Z","updated_at":"2018-11-16T15:43:54Z","author_association":"CONTRIBUTOR","body":"Here it is:\r\n\r\n```\r\nconst config = require(\"./data/SiteConfig\");\r\nconst urljoin = require(\"url-join\");\r\n\r\nmodule.exports = {\r\n  pathPrefix: config.pathPrefix,\r\n  siteMetadata: {\r\n    siteUrl: urljoin(config.siteUrl, config.pathPrefix),\r\n    rssMetadata: {\r\n      site_url: urljoin(config.siteUrl, config.pathPrefix),\r\n      feed_url: urljoin(config.siteUrl, config.pathPrefix, config.siteRss),\r\n      title: config.siteTitle,\r\n      description: config.siteDescription,\r\n      image_url: `${urljoin(\r\n        config.siteUrl,\r\n        config.pathPrefix\r\n      )}/logos/logo-512.png`,\r\n      author: config.userName,\r\n      copyright: config.copyright\r\n    }\r\n  },\r\n  plugins: [\r\n    \"gatsby-plugin-react-helmet\",\r\n    {\r\n      resolve: `gatsby-plugin-favicon`,\r\n      options: {\r\n        logo: \"./static/logos/favicon.png\",\r\n        injectHTML: true,\r\n        icons: {\r\n          android: true,\r\n          appleIcon: true,\r\n          appleStartup: true,\r\n          coast: false,\r\n          favicons: true,\r\n          firefox: true,\r\n          twitter: true,\r\n          yandex: false,\r\n          windows: true\r\n        }\r\n      }\r\n    },\r\n    \"gatsby-plugin-lodash\",\r\n    {\r\n      resolve: \"gatsby-source-filesystem\",\r\n      options: {\r\n        name: \"assets\",\r\n        path: `${__dirname}/static/`\r\n      }\r\n    },\r\n    {\r\n      resolve: \"gatsby-source-filesystem\",\r\n      options: {\r\n        name: \"posts\",\r\n        path: `${__dirname}/content/`\r\n      }\r\n    },\r\n    {\r\n      resolve: \"gatsby-transformer-remark\",\r\n      options: {\r\n        plugins: [\r\n          {\r\n            resolve: \"gatsby-remark-images\",\r\n            options: {\r\n              maxWidth: 690\r\n            }\r\n          },\r\n          {\r\n            resolve: \"gatsby-remark-responsive-iframe\"\r\n          },\r\n          \"gatsby-remark-prismjs\",\r\n          \"gatsby-remark-copy-linked-files\",\r\n          \"gatsby-remark-autolink-headers\"\r\n        ]\r\n      }\r\n    },\r\n    {\r\n      resolve: \"gatsby-plugin-google-analytics\",\r\n      options: {\r\n        trackingId: config.googleAnalyticsID\r\n      }\r\n    },\r\n    {\r\n      resolve: \"gatsby-plugin-nprogress\",\r\n      options: {\r\n        color: config.themeColor\r\n      }\r\n    },\r\n    \"gatsby-plugin-sharp\",\r\n    \"gatsby-plugin-catch-links\",\r\n    \"gatsby-plugin-twitter\",\r\n    \"gatsby-plugin-sass\",\r\n    \"gatsby-plugin-sitemap\",\r\n    {\r\n      resolve: \"gatsby-plugin-manifest\",\r\n      options: {\r\n        name: config.siteTitle,\r\n        short_name: config.siteTitleShort,\r\n        description: config.siteDescription,\r\n        start_url: config.pathPrefix,\r\n        background_color: config.backgroundColor,\r\n        theme_color: config.themeColor,\r\n        display: \"minimal-ui\",\r\n        icons: [\r\n          {\r\n            src: \"/logos/logo-192x192.png\",\r\n            sizes: \"192x192\",\r\n            type: \"image/png\"\r\n          },\r\n          {\r\n            src: \"/logos/logo-512x512.png\",\r\n            sizes: \"512x512\",\r\n            type: \"image/png\"\r\n          }\r\n        ]\r\n      }\r\n    },\r\n    \"gatsby-plugin-offline\",\r\n    {\r\n      resolve: \"gatsby-plugin-feed\",\r\n      options: {\r\n        setup(ref) {\r\n          const ret = ref.query.site.siteMetadata.rssMetadata;\r\n          ret.allMarkdownRemark = ref.query.allMarkdownRemark;\r\n          ret.generator = \"GatsbyJS Material Starter\";\r\n          return ret;\r\n        },\r\n        query: `\r\n        {\r\n          site {\r\n            siteMetadata {\r\n              rssMetadata {\r\n                site_url\r\n                feed_url\r\n                title\r\n                description\r\n                image_url\r\n                author\r\n                copyright\r\n              }\r\n            }\r\n          }\r\n        }\r\n      `,\r\n        feeds: [\r\n          {\r\n            serialize(ctx) {\r\n              const { rssMetadata } = ctx.query.site.siteMetadata;\r\n              return ctx.query.allMarkdownRemark.edges.map(edge => ({\r\n                categories: edge.node.frontmatter.tags,\r\n                date: edge.node.fields.date,\r\n                title: edge.node.frontmatter.title,\r\n                description: edge.node.excerpt,\r\n                author: rssMetadata.author,\r\n                url: rssMetadata.site_url + edge.node.fields.slug,\r\n                guid: rssMetadata.site_url + edge.node.fields.slug,\r\n                custom_elements: [{ \"content:encoded\": edge.node.html }]\r\n              }));\r\n            },\r\n            query: `\r\n            {\r\n              allMarkdownRemark(\r\n                limit: 1000,\r\n                filter: {frontmatter: { published: {eq: true}}}\r\n                sort: { order: DESC, fields: [fields___date] },\r\n              ) {\r\n                edges {\r\n                  node {\r\n                    excerpt\r\n                    html\r\n                    timeToRead\r\n                    fields {\r\n                      slug\r\n                      date\r\n                    }\r\n                    frontmatter {\r\n                      title\r\n                      cover\r\n                      date\r\n                      category\r\n                      tags\r\n                    }\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          `,\r\n            output: config.siteRss\r\n          }\r\n        ]\r\n      }\r\n    }\r\n  ]\r\n};\r\n\r\n```"}}
{"actor":{"display_login":"paulisloud"}}