Commit 1134602d authored by Dario Pinto's avatar Dario Pinto
Browse files

Merge branch '404' into 'master'

Add the creepy 404 page

See merge request !91
parents 74d709cb 519bb74a
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -3,6 +3,7 @@
<head>
<title>![title] | OCamlPro</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="![description]" />
<meta name="keywords" content="![keywords]" />
<link rel="icon" type="image/svg+xml" href="/assets/img/logo_ocp_icon.svg">
......
......@@ -3,7 +3,41 @@ let error_msg code reason = Format.sprintf "<h1>Error: %d - %s</h1>" code reason
let page code reason =
let content =
match code with
| 404 -> Format.sprintf {|%s<br />|} (error_msg code reason)
| 404 -> {html|
<style type="text/css">
body {
background-color: black;
}
br, hr {
display: none;
}
h1 {
text-align: center;
position: fixed;
color: black;
left: 0;
right: 0;
top: 40%;
z-index: 1;
font-family: helvetica;
text-transform: uppercase;
font-size: 6vmin;
font-weight: bold;
mix-blend-mode: overlay;
user-select: none;
text-shadow: 0 0 .7vmin black;
}
footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
text-align: center;
}
</style>
<h1>Error 404</h1>
<script src="/assets/js/404.js"></script>
|html}
| n -> error_msg n reason
in
content
......@@ -83,7 +83,8 @@ let blog_asset_loader _root path _request =
| None -> Dream.empty `Not_Found
| Some asset -> Dream.respond asset
let feed_loader _root _path _request = Dream.respond Feed.generate
let feed_loader _root _path _request =
Dream.respond ~headers:["content-type","application/rss+xml"] Feed.generate
let page path =
match read_content (path ^ ".md") with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment