Improve
This commit is contained in:
parent
566c28367e
commit
f721c3426d
4 changed files with 6 additions and 15 deletions
|
@ -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/"))))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -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)))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue