Skip to content

Commit

Permalink
Do not display title in 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
royarg02 committed May 4, 2023
1 parent e0734a2 commit 8d17e4a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
27 changes: 27 additions & 0 deletions assets/css/conditionals/404.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.bsod {
border-radius: 0rem;
background-color: #1173AA !important;
color: #FFFFFF !important;
font-family: 'Segoe UI', sans-serif;
padding: 3rem;
}

.bsod > h2 {
font-size: 9.375rem;
font-weight: 400;
margin: 0rem 0rem 0.5rem 0rem;
}

.bsod > p {
padding: 0rem 0rem 0rem 1rem;
}

.bsod > p:first-of-type {
margin: 0.5rem 0rem 2rem 0rem;
font-size: 1.5rem;
}

.bsod > p:last-of-type {
margin: 0rem;
font-size: 1rem;
}
1 change: 1 addition & 0 deletions layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ <h2>:(</h2>
Page not found. Check the destination url again or use the links in this
page to find what you're looking for.
</p>
<p>You can search for the error online: 404_PAGE_NOT_FOUND</p>
{{ end }}
10 changes: 7 additions & 3 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@
<link rel="{{ $entry.name | default "icon" }}"{{ with $entry.size }} sizes="{{ . }}"{{ end }} href="{{ $entry.file | absURL }}">
{{ end }}
{{- end }}
{{ $CSS := resources.Match "css/*.css" | resources.Concat "style.css" | resources.Minify | resources.Fingerprint }}
{{- $CSS := resources.Match "css/*.css" | resources.Concat "style.css" | resources.Minify | resources.Fingerprint -}}
<link rel="stylesheet" type="text/css" href="{{ $CSS.RelPermalink }}">
{{ if .IsPage }}
{{ $pageCSS := resources.GetMatch "css/conditionals/page.css" | resources.Minify | resources.Fingerprint }}
{{- $pageCSS := resources.GetMatch "css/conditionals/page.css" | resources.Minify | resources.Fingerprint -}}
<link rel="stylesheet" type="text/css" href="{{ $pageCSS.RelPermalink }}">
{{ end }}
{{ if (eq .Page.Kind "404") }}
{{- $404CSS := resources.GetMatch "css/conditionals/404.css" | resources.Minify | resources.Fingerprint -}}
<link rel="stylesheet" type="text/css" href="{{ $404CSS.RelPermalink }}">
{{ end }}
{{ with .Params.author -}}
<meta name="author" content="{{ . }}">
{{- end }}
Expand All @@ -48,7 +52,7 @@
{{ block "header" . }}
{{ partial "header.html" . }}
{{ end }}
<main>
<main {{ if (eq .Page.Kind "404") }}class="bsod"{{ end }}>
{{ block "main" . }}
{{ .Content }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<header>
<h1 id="site-title"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
{{ if not .IsHome }}
<h1 id="content-title">{{ .LinkTitle | markdownify }}</h1>
{{ if not (eq .Page.Kind "404") }}<h1 id="content-title">{{ .LinkTitle | markdownify }}</h1>{{ end }}
{{ if .IsPage }}
<p id="publishdate">{{ .Date | dateFormat ":date_medium" }}</p>
{{ partial "list-content-tags" . }}
Expand Down

0 comments on commit 8d17e4a

Please sign in to comment.