Skip to content

Commit fed6c65

Browse files
authored
Fix: Restore custom 404 page
GitHub Pages requires the page to be located in the root of the content directory and named 404.html See https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site - - - - - - - - - - - - - - - - - - - - Close #988
1 parent 4621cc1 commit fed6c65

File tree

4 files changed

+1
-16
lines changed

4 files changed

+1
-16
lines changed

docs/404/index.html docs/404.html

File renamed without changes.

docs/404/index.asp

-3
This file was deleted.

gulpfile.js

-12
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,6 @@ gulp.task('move:images', moveImages);
254254
gulp.task('move:scanimages', moveScanImages);
255255
gulp.task('optimize:images', gulp.series('move:docimage', 'imagemin', 'move:images', 'move:scanimages'));
256256

257-
gulp.task('404', (done) => {
258-
const lostContent = fs.readFileSync(`${dirs.dist}/404/index.html`, 'utf-8'); // eslint-disable-line no-sync
259-
const asp404 = `<%@ EnableSessionState=False %>
260-
<% Response.Status = "404" %>
261-
${lostContent}`;
262-
263-
fs.writeFileSync(`${dirs.dist}/404/index.asp`, asp404, 'utf-8'); // eslint-disable-line no-sync
264-
265-
done();
266-
});
267-
268257
// ---------------------------------------------------------------------
269258
// | Main tasks |
270259
// ---------------------------------------------------------------------
@@ -359,7 +348,6 @@ gulp.task('build', gulp.series(
359348
// TODO: Re-enable pre-compression once supported by GitHub Pages
360349
//'compress:zopfli',
361350
//'compress:brotli',
362-
'404'
363351
));
364352

365353
gulp.task('default', gulp.series('build'));

src/content/404.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
section: "placeholder-pages"
33
layout: "error"
44
originalFile: "404.md"
5-
permalink: "404/index.html"
5+
permalink: "404.html"
66
title: "Oh oh"
77
contentType: "details"
88
sitemap: "false"

0 commit comments

Comments
 (0)