Use flute instead of markup

This commit is contained in:
Akira Tempaku 2024-02-03 13:57:35 +09:00
parent c0529119f9
commit ef0cd5b77e
4 changed files with 26 additions and 28 deletions

2
qlfile
View file

@ -5,4 +5,4 @@ ql alexandria
ql lack ql lack
ql clack ql clack
ql cl-jingle ql cl-jingle
ql markup git flute https://github.com/skyizwhite/flute.git

View file

@ -30,7 +30,7 @@
(:class qlot/source/ql:source-ql (:class qlot/source/ql:source-ql
:initargs (:%version :latest) :initargs (:%version :latest)
:version "ql-2023-10-21")) :version "ql-2023-10-21"))
("markup" . ("flute" .
(:class qlot/source/ql:source-ql (:class qlot/source/git:source-git
:initargs (:%version :latest) :initargs (:remote-url "https://github.com/skyizwhite/flute.git")
:version "ql-2023-10-21")) :version "git-a4bf72232f5de50b826d618f7b6ae0e75494e6f3"))

View file

@ -1,29 +1,29 @@
(defpackage #:hp/routes/index (defpackage #:hp/routes/index
(:use #:cl) (:use #:cl)
(:local-nicknames (#:mk #:markup)) (:local-nicknames (#:f #:flute))
(:local-nicknames (#:jg #:jingle)) (:local-nicknames (#:jg #:jingle))
(:local-nicknames (#:ui #:hp/ui/*)) (:local-nicknames (#:ui #:hp/ui/*))
(:local-nicknames (#:utils #:hp/utils/*)) (:local-nicknames (#:utils #:hp/utils/*))
(:export #:*index-app*)) (:export #:*index-app*))
(in-package #:hp/routes/index) (in-package #:hp/routes/index)
(mk:enable-reader)
;;; View ;;; View
(mk:deftag page () (f:define-element page ()
<ui:layout> (f:h
<section class="h-full flex justify-center items-center" > (ui:layout
<h1 class="text-4xl text-amber-500" >Hello HTMX from Common Lisp!</h1> (section
</section> :class "h-full flex justify-center items-center"
</ui:layout>) (h1
:class "text-4xl text-amber-500"
"Hello HTMX from Common Lisp!")))))
;;; Controller ;;; Controller
(defun index (params) (defun index (params)
(declare (ignore params)) (declare (ignore params))
(jg:with-html-response (jg:with-html-response
(mk:write-html <page />))) (f:element-string (page))))
(defparameter *index-app* (jg:make-app)) (defparameter *index-app* (jg:make-app))

View file

@ -1,18 +1,16 @@
(defpackage #:hp/ui/layout (defpackage #:hp/ui/layout
(:use #:cl) (:use #:cl)
(:local-nicknames (#:mk #:markup)) (:local-nicknames (#:f #:flute))
(:export #:layout)) (:export #:layout))
(in-package #:hp/ui/layout) (in-package #:hp/ui/layout)
(markup:enable-reader) (f:define-element layout ()
(f:h
(mk:deftag layout (children) (html
<html> (head
<head> (title "skyizwhite.dev")
<title>skyizwhite.dev</title> (script :src "/static/htmx.min.js")
<script src="/static/htmx.min.js" ></script> (link :href "/static/main.css" :rel "stylesheet")
<link href="/static/main.css" rel="stylesheet"> (link :href "/static/tailwind.css" :rel "stylesheet"))
<link href="/static/tailwind.css" rel="stylesheet"> (body :class "h-[100svh]"
</head> f:children))))
<body class="h-[100svh]" >,@(progn children)</body>
</html>)