Skip to content

Commit 1d26bdc

Browse files
Copilotleecalcote
andcommitted
fix: prevent double .html suffix in CI builds by checking if path already ends in .html
Co-authored-by: leecalcote <7570704+leecalcote@users.noreply.github.com>
1 parent b31f2db commit 1d26bdc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

gatsby-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (process.env.CI === "true") {
1919
// All process.env.CI conditionals in this file are in place for GitHub Pages, if webhost changes in the future, code may need to be modified or removed.
2020
//Replacing '/' would result in empty string which is invalid
2121
const replacePath = (url) =>
22-
url === "/" || url.includes("/404") ? url : `${url}.html`;
22+
url === "/" || url.includes("/404") || url.endsWith(".html") ? url : `${url}.html`;
2323

2424
exports.onCreatePage = ({ page, actions }) => {
2525
const { createPage, deletePage, createRedirect } = actions;

0 commit comments

Comments
 (0)