M wiki/404.html => wiki/404.html +2 -0
@@ 11,5 11,7 @@
<p>Whatever you're looking for, it's not here. Unless you're
looking for the 404 error page. If that's what you want,
congratulations. You found it.</p>
+
+ <p>Maybe try going <a href="/">back to home</a> for now.</p>
</body>
</html>
M wiki/index.fnl => wiki/index.fnl +16 -10
@@ 7,7 7,6 @@
"<!DOCTYPE html>
<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"\" xml:lang=\"\">
<head>
- <meta charset=\"utf-8\" />
<link rel=\"stylesheet\" href=\"https://fennel-lang.org/fennel.css\"></link>
<link rel=\"stylesheet\" href=\"https://code.cdn.mozilla.net/fonts/fira.css\"/>
<title>Fennel wiki: %s</title>
@@ 39,12 38,19 @@
(let [page (match (query-string) "" "Home" p p)
body (get-body (query-string))
- out [(head:format page)
- (string.format "<h1>Fennel wiki: %s</h1>" page)
- ;; this leaves a ton of unmatched closing divs but who cares
- (body:match "<div id=\"wiki%-body\".*</turbo%-frame>")
- foot]]
- (print "content-encoding: utf8")
- (print "content-type: text/html")
- (print "")
- (print (table.concat out "\n")))
+ out (if (not= 0 (length body))
+ [(head:format page)
+ (string.format "<h1>Fennel wiki: %s</h1>" page)
+ ;; this leaves a ton of unmatched closing divs but who cares
+ (body:match "<div id=\"wiki%-body\".*</turbo%-frame>")
+ foot])]
+ (if out
+ (do
+ (print "content-encoding: utf8")
+ (print "content-type: text/html")
+ (print "")
+ (print (table.concat out "\n")))
+ (do
+ (print "status: 404 not found")
+ (print "")
+ (print (with-open [f (io.open "404.html")] (f:read :*all))))))