1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2024-09-28 14:57: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", {
statusCode: 400,
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 {
statusCode: 400,
contentType: "text/html",
content: "That page does not exist"
content: "That page does not exist."
}
}
}).catch(error => {
@ -80,7 +81,8 @@ module.exports = [
return render(400, "pug/friendlyerror.pug", {
statusCode: 400,
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
h1.code= statusCode
p.message= message
if explanation
p.explanation= explanation
a(href="javascript:history.back()").back ← Go back?

View File

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