summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJake Zerrer <him@jakezerrer.com>2025-08-13 10:38:04 -0400
committerJake Zerrer <him@jakezerrer.com>2025-08-13 10:39:16 -0400
commit7580c5cebe6cf47893982b59bc8cad0167cf2066 (patch)
tree04723c9c3198628d596fcffd4eb5c4e10b29930c /src
parent8eedd0e68f62bdf0fab2e40ce2963551bd65e8bc (diff)
Add 404 page
Diffstat (limited to 'src')
-rw-r--r--src/core.clj5
-rw-r--r--src/pages.clj14
2 files changed, 14 insertions, 5 deletions
diff --git a/src/core.clj b/src/core.clj
index 4fc90a9..b2b0d08 100644
--- a/src/core.clj
+++ b/src/core.clj
@@ -1,6 +1,6 @@
(ns core
(:require [clojure.java.io :as io]
- [pages :refer [pages]]))
+ [pages :refer [pages e-404]]))
(defn clean []
(let [target-dir (io/file "target")]
@@ -19,7 +19,8 @@
(str "target/html" path "/index.html"))
target-file (io/file target-path)]
(io/make-parents target-file)
- (spit target-file (str (page-fn))))))
+ (spit target-file (str (page-fn)))))
+ (spit (io/file "target/html/404.html") (str (e-404))))
(defn -main []
(clean)
diff --git a/src/pages.clj b/src/pages.clj
index a1a71aa..ced4498 100644
--- a/src/pages.clj
+++ b/src/pages.clj
@@ -79,15 +79,23 @@
[:p "This is an example of a post with a code block:"]
(code
(highlight-clj
- (println "hello, world!")))
+ (println "hello, world!")))
[:p "Looks pretty good."]])))
+(defn e-404 []
+ (page
+ (html
+ [:<>
+ [:h1 "404 Oh, be some other path!"]
+ [:p "What's in a path? That which we call a page"
+ [:br]
+ "by any other path would fail to load"]])))
+
(defn pages []
{home-uri home
books-2025-uri books-2025
code-example-uri code-example
- past-work-uri past-work
- })
+ past-work-uri past-work})
(comment
(require '[repl :refer [restart build]])