Add htmx, alpine.js, pico.css

This commit is contained in:
Akira Tempaku 2024-06-15 17:05:39 +09:00
commit 07bff148ec
5 changed files with 11 additions and 8 deletions

View file

@ -25,7 +25,6 @@
(fbr:assign-routes *app* :system "hp" :directory "src/routes") (fbr:assign-routes *app* :system "hp" :directory "src/routes")
(jg:install-middleware *app* mw:*path-normalizer*) (jg:install-middleware *app* mw:*path-normalizer*)
(jg:install-middleware *app* mw:*public-server*) (jg:install-middleware *app* mw:*public-server*)
(jg:install-middleware *app* mw:*access-logger*)
(jg:install-middleware *app* mw:*recoverer*)) (jg:install-middleware *app* mw:*recoverer*))
(defun update () (defun update ()

View file

@ -9,6 +9,12 @@
(html :lang "ja" (html :lang "ja"
(head (head
(meta :charset "UTF-8") (meta :charset "UTF-8")
(meta :name "viewport" :content "width=device-width, initial-scale=1")
(meta :name "color-scheme" :content "light dark")
(link :rel "stylesheet" :href "https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css")
(script :src "https://cdn.jsdelivr.net/npm/htmx.org@1.9.12/dist/htmx.min.js")
(script :src "https://cdn.jsdelivr.net/npm/htmx.org@1.9.12/dist/ext/head-support.js")
(script :src "https://cdn.jsdelivr.net/npm/alpinejs@3.14.0/dist/cdn.min.js" :defer t)
(title (format nil "~@[~a - ~]skyizwhite.dev" title)) (title (format nil "~@[~a - ~]skyizwhite.dev" title))
(meta (meta
:name "description" :name "description"

View file

@ -6,8 +6,6 @@
(defcomp layout (&key children) (defcomp layout (&key children)
(hsx (hsx
(body (body :hx-ext "head-support"
(header) (main :class "container"
(main children))))
children)
(footer))))

View file

@ -11,7 +11,7 @@
(defun response (page &key status metadata) (defun response (page &key status metadata)
(jg:with-html-response (jg:with-html-response
(if status (jg:set-response-status status)) (if status (jg:set-response-status status))
(hsx:render-to-string (cmp:document :metadata metadata (hsx:render-to-string (cmp:document metadata
(cmp:layout page))))) (cmp:layout page)))))
(defun partial-response (component &key status) (defun partial-response (component &key status)

View file

@ -7,7 +7,7 @@
(defcomp page () (defcomp page ()
(hsx (hsx
(h1 "Hello, World!"))) (h1 "こんにちは")))
(defun handle-get (params) (defun handle-get (params)
(declare (ignore params)) (declare (ignore params))