This commit is contained in:
Akira Tempaku 2024-04-12 17:36:28 +09:00
parent 566c28367e
commit f721c3426d
4 changed files with 6 additions and 15 deletions

View file

@ -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/"))))

View file

@ -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)

View file

@ -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)))

View file

@ -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)))))))