Skip to content

Commit

Permalink
Add 404 page (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmakestech authored Jan 5, 2022
1 parent 612890f commit 25da717
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ hugo server -F
And open <a href="http://localhost:1313/">http://localhost:1313/</a> in your
browser. Note that the -F flag will show items to be published in the future
(like blog posts with dates in the future).

To view the 404 page when running locally, use <a href="http://localhost:1313/404.html">/404.html</a>.
3 changes: 3 additions & 0 deletions layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ define "main"}}
<section class="position-relative text-center pt-2 pb-2">That page doesn't exist, please check the address.</section>
{{ end }}
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,9 @@
to = "https://www.memorysafety.org/:splat"
status = 301
force = true

[[redirects]]
from = "/*"
to = "/404.html"
status = 404
force = false

0 comments on commit 25da717

Please sign in to comment.