Skip to content

Commit 9d8516a

Browse files
committed
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 <abhirajmarne11@gmail.com>
1 parent 6b7a832 commit 9d8516a

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

gatsby-node.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
5454
const { createPage } = actions;
5555

5656
const envCreatePage = (props) => {
57-
const pageProps = {
58-
...props,
59-
};
60-
61-
if (process.env.CI === "true") {
62-
const { path } = pageProps;
63-
createRedirect({
64-
fromPath: `/${path}/`,
65-
toPath: `/${path}`,
66-
redirectInBrowser: true,
67-
isPermanent: true,
68-
});
69-
}
70-
71-
return createPage(pageProps);
57+
return createPage(props);
7258
};
7359

7460
const blogPostTemplate = path.resolve("src/templates/blog-single.js");

0 commit comments

Comments
 (0)