Skip to content

Commit

Permalink
fix: 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
fpasquet committed Feb 28, 2024
1 parent d0f8cb7 commit d264b4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/prerenderHelper/generateHtmlFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const generateHtmlFiles = async (options: {

const urlWithoutBaseUrl = url.replace(options.baseUrl, '');
let fileName = 'index.html';
if (urlWithoutBaseUrl === '404') {
if (url.match(/\/404\/$/)) {
fileName = '404.html';
} else if (urlWithoutBaseUrl) {
fileName = `${urlWithoutBaseUrl}/index.html`;
Expand Down
5 changes: 5 additions & 0 deletions src/helpers/prerenderHelper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export const generateFiles = async (options: { rootDir: string; baseUrl: string
url: param.url.replace(/^\//, options.baseUrl || '/'),
}));

urls.push({
lang: 'fr',
url: `${options.baseUrl || '/'}404/`,
});

await Promise.all([
generateHtmlFiles({
rootDir: __dirname,
Expand Down

0 comments on commit d264b4c

Please sign in to comment.