From 9d8516a1243425f572828a8a526d067b1fe352a4 Mon Sep 17 00:00:00 2001 From: Abmarne Date: Wed, 15 Apr 2026 16:55:58 +0530 Subject: [PATCH] refactor(gatsby-node): simplify page creation logic and remove redundant redirects - Removed creation of redundant redirects for page paths during CI builds ref-actor Simplified(gatsby-node): simplify page creation and remove lite mode redirects env CreatePage wrapper to directly call createPage - Removed legacy lite mode redirects and related placeholder pages - Simplified env- Retained all page templates andCreate GraphQL queries without modification -Page function to directly call createPage without redirects Kept collection filtering and pagination- Removed redundant slug slash redirects in CI environment logic intact - Kept existing GraphQL queries and page creation- No logic intact - Maintained excluded collections handling and functional changes to node field creation or schema customization full site build flag - Ensured dev - Improved code clarity 404 page caching and webpack config remain unchanged by removing unnecessary redirect side effects Signed-off-by: Abmarne --- gatsby-node.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index ab57ad317fe6c..0281d5cb232fc 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -54,21 +54,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => { const { createPage } = actions; const envCreatePage = (props) => { - const pageProps = { - ...props, - }; - - if (process.env.CI === "true") { - const { path } = pageProps; - createRedirect({ - fromPath: `/${path}/`, - toPath: `/${path}`, - redirectInBrowser: true, - isPermanent: true, - }); - } - - return createPage(pageProps); + return createPage(props); }; const blogPostTemplate = path.resolve("src/templates/blog-single.js");