Skip to content

Commit

Permalink
Simplify 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
g1eny0ung committed Jun 5, 2020
1 parent 4f405e5 commit b07d6e2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion exampleSite/config.toml
Expand Up @@ -35,4 +35,4 @@ theme = "hugo-theme-dream"
# dark mode
darkLinkColor = "darkseagreen"
darkNav = true
dark404Button = true
dark404 = true
23 changes: 16 additions & 7 deletions layouts/404.html
@@ -1,16 +1,25 @@
{{ define "title" }}404 Page Not Found{{ end }}
{{ define "title" }}404 Not Found{{ end }}

{{ define "main" }}
<div class="ui container dream-404-container">
<div class="ui basic center aligned segment">
<img class="ui centered image dream-404-image" src="/img/404.png" alt="404">
<p>
{{ if .Site.Params.dark404Button }}
{{ if .Site.Params.dark404 }}
<h1 class="ui inverted header">
Oops ... You are lost in dream.
<div class="sub header">Don't worry though, click the button below to wake up.</div>
</h1>
<p>
<button class="ui inverted button" onclick="window.location.href = '/'">{{ i18n "backToHome" }}</button>
{{ else }}
</p>
{{ else }}
<h2 class="ui header">
Oops...You are lost in dream.
<div class="sub header">Don't worry though, click the button below to wake up.</div>
</h2>
<p>
<button class="ui button" onclick="window.location.href = '/'">{{ i18n "backToHome" }}</button>
{{ end }}
</p>
</p>
{{ end }}
</div>
</div>
{{ end }}
8 changes: 6 additions & 2 deletions src/sass/site.scss
Expand Up @@ -70,8 +70,12 @@ body {
display: flex !important;
height: $ContainerHeight;

.dream-404-image {
padding-bottom: 10rem;
.ui.header {
margin-bottom: 2rem;

.sub.header {
margin-top: 0.5rem;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion static/css/site.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed static/img/404.png
Binary file not shown.

0 comments on commit b07d6e2

Please sign in to comment.