Skip to content

Commit d415a34

Browse files
remove .html slug from gatbsy.node
Signed-off-by: Rajesh-Nagarajan-11 <rajeshnagarajan36@gmail.com>
1 parent 93d5f5a commit d415a34

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

gatsby-node.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,16 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
469469
}
470470

471471
handbook.forEach((page) => {
472+
let finalSlug = page.fields.slug;
473+
if (process.env.NODE_ENV === "production") {
474+
finalSlug = finalSlug.replace(/\.html$/, "");
475+
}
476+
472477
envCreatePage({
473-
path: page.fields.slug,
478+
path: finalSlug,
474479
component: `${HandbookTemplate}?__contentFilePath=${page.internal.contentFilePath}`,
475480
context: {
476-
slug: page.fields.slug,
481+
slug: finalSlug,
477482
},
478483
});
479484
});

0 commit comments

Comments
 (0)