1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2024-11-23 00:27:30 +00:00
This commit is contained in:
Cadence Fish 2020-01-29 01:17:32 +13:00
parent 29e56134ce
commit e8e565605f
No known key found for this signature in database
GPG Key ID: 81015DF9AA8607E1
3 changed files with 15 additions and 6 deletions

View File

@ -15,7 +15,8 @@ module.exports = [
return render(400, "pug/friendlyerror.pug", { return render(400, "pug/friendlyerror.pug", {
statusCode: 400, statusCode: 400,
title: "Bad request", title: "Bad request",
message: "Expected a username." message: "Expected a username",
explanation: "Write /u/{username} or /u?u={username}."
}) })
} }
} }
@ -54,7 +55,7 @@ module.exports = [
return { return {
statusCode: 400, statusCode: 400,
contentType: "text/html", contentType: "text/html",
content: "That page does not exist" content: "That page does not exist."
} }
} }
}).catch(error => { }).catch(error => {
@ -80,7 +81,8 @@ module.exports = [
return render(400, "pug/friendlyerror.pug", { return render(400, "pug/friendlyerror.pug", {
statusCode: 400, statusCode: 400,
title: "Bad request", title: "Bad request",
message: "Expected a username." message: "Expected a shortcode",
explanation: "Write /p/{shortcode} or /p?u={shortcode}."
}) })
} }
} }

View File

@ -15,4 +15,6 @@ html
body.error-page body.error-page
h1.code= statusCode h1.code= statusCode
p.message= message p.message= message
if explanation
p.explanation= explanation
a(href="javascript:history.back()").back ← Go back? a(href="javascript:history.back()").back ← Go back?

View File

@ -260,6 +260,7 @@ body
margin-bottom: 10px margin-bottom: 10px
.error-page .error-page
box-sizing: border-box
min-height: 100vh min-height: 100vh
background: #191919 background: #191919
padding: 10px padding: 10px
@ -269,10 +270,9 @@ body
justify-content: center justify-content: center
align-items: center align-items: center
.code, .message, .back-link .code, .message, .explanation, .back-link
line-height: 1.2 line-height: 1.2
margin: 0px margin: 0px
color: white
.code .code
font-size: 80px font-size: 80px
@ -282,9 +282,14 @@ body
.message .message
font-size: 35px font-size: 35px
color: #ccc color: #ccc
margin-bottom: 15vh
.explanation
margin-top: 10px
font-size: 20px
color: #bbb
.back .back
margin-top: 15vh
color: #4a93d2 color: #4a93d2
font-size: 25px font-size: 25px