From d323b8fcbe0d4042dc08a6c25dc9e248a4b4b376 Mon Sep 17 00:00:00 2001 From: nat Date: Sun, 11 May 2025 15:36:23 -0700 Subject: [PATCH] add route for thoughts/blog --- srv/content/router.hy | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/srv/content/router.hy b/srv/content/router.hy index 441b5cf..8d6bd36 100644 --- a/srv/content/router.hy +++ b/srv/content/router.hy @@ -8,6 +8,9 @@ (import bleach [clean]) (import validators [domain :as domain?]) +(defmacro unless [test #* body] + `(when (not ~test) (do ~@body))) + (defn error [code message] (return (dict :code code @@ -30,9 +33,14 @@ (return (error 405 "method not allowed"))) (when (file? (+ "./www/site/html" path)) + (unless (= path "/html/view-thought.html") + (return (dict + :code 200 + :body (parse-html-file f"./www/site/html{path}")))) + (return (dict :code 200 - :body (parse-html-file f"./www/site/html{path}"))))) + :body (parse-html-file "./www/site/html/html/view-thought.html" #** (. request (get "route") (get "parameters"))))))) (when (= path "/style.css") (when (!= method "GET")