diff --git a/src/middleware.lisp b/src/middleware.lisp index 918041d..6f0755f 100644 --- a/src/middleware.lisp +++ b/src/middleware.lisp @@ -15,7 +15,5 @@ (funcall *lack-middleware-static* app :path (lambda (path) - (if (exist-public-file-p path) - path - nil)) + (and (exist-public-file-p path) path)) :root (asdf:system-relative-pathname :hp "public/")))) diff --git a/src/routes/about.lisp b/src/routes/about.lisp index a015711..a30d368 100644 --- a/src/routes/about.lisp +++ b/src/routes/about.lisp @@ -5,15 +5,11 @@ (:export #:on-get)) (in-package #:hp/routes/about) -;;; View - (pi:define-element page () (pi:h (section (h1 "About")))) -;;; Controller - (defun on-get (params) (declare (ignore params)) (view:render (page) diff --git a/src/routes/index.lisp b/src/routes/index.lisp index 118157b..4cd9fa8 100644 --- a/src/routes/index.lisp +++ b/src/routes/index.lisp @@ -5,8 +5,6 @@ (:export #:on-get)) (in-package #:hp/routes/index) -;;; View - (pi:define-element page () (pi:h (section @@ -14,8 +12,6 @@ (a :href "/about" :hx-boost "true" "About")))) -;;; Controller - (defun on-get (params) (declare (ignore params)) (view:render (page))) diff --git a/src/view.lisp b/src/view.lisp index 3b74507..9a578cc 100644 --- a/src/view.lisp +++ b/src/view.lisp @@ -12,7 +12,8 @@ (pi:elem-str (let ((md (cmp:metadata :title title :description description)) (body (cmp:layout page))) - (if (jg:get-request-header "HX-Boosted") - (pi:h (<> md body)) - (pi:h (cmp:document :metadata md - body))))))) + (pi:h + (if (jg:get-request-header "HX-Boosted") + (<> md body) + (cmp:document :metadata md + body)))))))