From 89c903d2fdc0e98a1f80e2fc98e36cd9e46c8eaa Mon Sep 17 00:00:00 2001 From: Clark McAdoo Date: Fri, 18 Nov 2022 12:36:27 -0600 Subject: [PATCH] fix: add code back to attempt to fix rss feed generation --- gatsby-config.js | 2 +- gatsby-node.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index a6c8895af99..e22c6ed14e5 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -32,6 +32,7 @@ const autoLinkHeaders = { }; module.exports = { + trailingSlash: 'always', flags: { DEV_SSR: true, PRESERVE_FILE_DOWNLOAD_CACHE: true, @@ -539,5 +540,4 @@ module.exports = { }, }, ], - trailingSlash: 'always', }; diff --git a/gatsby-node.js b/gatsby-node.js index 235dc477280..80d6963ca91 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -394,12 +394,9 @@ const createLocalizedRedirect = ({ createRedirect, }) => { // Create redirects - const pathWithTrailingSlash = hasTrailingSlash(fromPath) - ? fromPath - : path.join(fromPath, '/'); createRedirect({ - fromPath: pathWithTrailingSlash, + fromPath, toPath: appendTrailingSlash(toPath), isPermanent, redirectInBrowser, @@ -407,7 +404,7 @@ const createLocalizedRedirect = ({ locales.forEach((locale) => { createRedirect({ - fromPath: path.join(`/${locale}`, pathWithTrailingSlash), + fromPath: path.join(`/${locale}`, fromPath), toPath: appendTrailingSlash(path.join(`/${locale}`, toPath)), isPermanent, redirectInBrowser,