mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-22 16:17:29 +00:00
Fix #15
This commit is contained in:
parent
29e56134ce
commit
e8e565605f
@ -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}."
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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?
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user