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*
|
(funcall *lack-middleware-static*
|
||||||
app
|
app
|
||||||
:path (lambda (path)
|
:path (lambda (path)
|
||||||
(if (exist-public-file-p path)
|
(and (exist-public-file-p path) path))
|
||||||
path
|
|
||||||
nil))
|
|
||||||
:root (asdf:system-relative-pathname :hp "public/"))))
|
:root (asdf:system-relative-pathname :hp "public/"))))
|
||||||
|
|
|
@ -5,15 +5,11 @@
|
||||||
(:export #:on-get))
|
(:export #:on-get))
|
||||||
(in-package #:hp/routes/about)
|
(in-package #:hp/routes/about)
|
||||||
|
|
||||||
;;; View
|
|
||||||
|
|
||||||
(pi:define-element page ()
|
(pi:define-element page ()
|
||||||
(pi:h
|
(pi:h
|
||||||
(section
|
(section
|
||||||
(h1 "About"))))
|
(h1 "About"))))
|
||||||
|
|
||||||
;;; Controller
|
|
||||||
|
|
||||||
(defun on-get (params)
|
(defun on-get (params)
|
||||||
(declare (ignore params))
|
(declare (ignore params))
|
||||||
(view:render (page)
|
(view:render (page)
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
(:export #:on-get))
|
(:export #:on-get))
|
||||||
(in-package #:hp/routes/index)
|
(in-package #:hp/routes/index)
|
||||||
|
|
||||||
;;; View
|
|
||||||
|
|
||||||
(pi:define-element page ()
|
(pi:define-element page ()
|
||||||
(pi:h
|
(pi:h
|
||||||
(section
|
(section
|
||||||
|
@ -14,8 +12,6 @@
|
||||||
(a :href "/about" :hx-boost "true"
|
(a :href "/about" :hx-boost "true"
|
||||||
"About"))))
|
"About"))))
|
||||||
|
|
||||||
;;; Controller
|
|
||||||
|
|
||||||
(defun on-get (params)
|
(defun on-get (params)
|
||||||
(declare (ignore params))
|
(declare (ignore params))
|
||||||
(view:render (page)))
|
(view:render (page)))
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
(pi:elem-str
|
(pi:elem-str
|
||||||
(let ((md (cmp:metadata :title title :description description))
|
(let ((md (cmp:metadata :title title :description description))
|
||||||
(body (cmp:layout page)))
|
(body (cmp:layout page)))
|
||||||
(if (jg:get-request-header "HX-Boosted")
|
(pi:h
|
||||||
(pi:h (<> md body))
|
(if (jg:get-request-header "HX-Boosted")
|
||||||
(pi:h (cmp:document :metadata md
|
(<> md body)
|
||||||
body)))))))
|
(cmp:document :metadata md
|
||||||
|
body)))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue