Verified Commit 9f48bec2 authored by doshitan's avatar doshitan

Custom 404 page

parent bce75897
......@@ -255,6 +255,19 @@ main = do
route idRoute
compileFeed "All posts" "posts/*" tags
-- custom error pages
for_ [(404, "Oops, could not find that page.")] $ \(code, msg) -> do
create [fromString (show code ++ ".html")] $ do
route idRoute
compile $ do
let ctx = mconcat [ constField "code" (show code)
, constField "body" msg
, baseCtx
]
makeItem ""
>>= loadAndApplyTemplate "templates/error.html" ctx
>>= loadAndApplyTemplate "templates/default.html" baseCtx
--------------------------------------------------------------------------------
listPosts :: String -> String -> Pattern -> Tags -> Rules ()
listPosts title description pattern' tags = compile $ do
......
......@@ -163,6 +163,11 @@ resource "aws_cloudfront_distribution" "site_distribution" {
}
}
custom_error_response {
error_code = 404
response_page_path = "/404.html"
}
viewer_certificate {
# TODO: use resource to generate this
# acm_certificate_arn = "${aws_acm_certificate.cert.arn}"
......
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