Improve view
This commit is contained in:
parent
f1c711ea43
commit
1d7f8b6ed5
5 changed files with 27 additions and 44 deletions
src
|
@ -5,7 +5,7 @@
|
||||||
(:local-nicknames (#:fbr #:ningle-fbr))
|
(:local-nicknames (#:fbr #:ningle-fbr))
|
||||||
(:local-nicknames (#:pi #:piccolo))
|
(:local-nicknames (#:pi #:piccolo))
|
||||||
(:local-nicknames (#:view #:hp/view))
|
(:local-nicknames (#:view #:hp/view))
|
||||||
(:local-nicknames (#:cmp #:hp/components/**/*))
|
(:local-nicknames (#:cmp #:hp/components/*))
|
||||||
(:local-nicknames (#:mw #:hp/middlewares/*))
|
(:local-nicknames (#:mw #:hp/middlewares/*))
|
||||||
(:export #:start
|
(:export #:start
|
||||||
#:stop
|
#:stop
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
(defpackage #:hp/components/global/document
|
|
||||||
(:use #:cl)
|
|
||||||
(:local-nicknames (#:pi #:piccolo))
|
|
||||||
(:export #:document))
|
|
||||||
(in-package #:hp/components/global/document)
|
|
||||||
|
|
||||||
(pi:define-element document (title description)
|
|
||||||
(pi:h
|
|
||||||
(html :lang "ja"
|
|
||||||
(head
|
|
||||||
(meta :charset "UTF-8")
|
|
||||||
(script :src "/scripts/htmx.js")
|
|
||||||
(script :src "/scripts/htmx-ext/head-support.js")
|
|
||||||
(script :src "/scripts/alpine.js" :defer t)
|
|
||||||
(link :rel "stylesheet" :type "text/css" :href "/styles/ress.css")
|
|
||||||
(link :rel "stylesheet" :type "text/css" :href "/styles/global.css")
|
|
||||||
(link :rel "preconnect" :href "https://fonts.googleapis.com")
|
|
||||||
(link :rel "preconnect" :href "https://fonts.gstatic.com" :crossorigin t)
|
|
||||||
(link
|
|
||||||
:rel "stylesheet"
|
|
||||||
:href "https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap")
|
|
||||||
(title (format nil "~@[~a - ~]skyizwhite.dev" title))
|
|
||||||
(meta
|
|
||||||
:name "description"
|
|
||||||
:content (or description "pakuの個人サイト")))
|
|
||||||
pi:children)))
|
|
|
@ -1,10 +0,0 @@
|
||||||
(defpackage #:hp/components/global/layout
|
|
||||||
(:use #:cl)
|
|
||||||
(:local-nicknames (#:pi #:piccolo))
|
|
||||||
(:export #:layout))
|
|
||||||
(in-package #:hp/components/global/layout)
|
|
||||||
|
|
||||||
(pi:define-element layout ()
|
|
||||||
(pi:h
|
|
||||||
(body :hx-ext "head-support"
|
|
||||||
(main pi:children))))
|
|
|
@ -1,8 +1,8 @@
|
||||||
(defpackage #:hp/components/global/not-found
|
(defpackage #:hp/components/not-found
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:local-nicknames (#:pi #:piccolo))
|
(:local-nicknames (#:pi #:piccolo))
|
||||||
(:export #:not-found-page))
|
(:export #:not-found-page))
|
||||||
(in-package #:hp/components/global/not-found)
|
(in-package #:hp/components/not-found)
|
||||||
|
|
||||||
(pi:define-element not-found-page ()
|
(pi:define-element not-found-page ()
|
||||||
(pi:h
|
(pi:h
|
|
@ -2,13 +2,32 @@
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:local-nicknames (#:jg #:jingle))
|
(:local-nicknames (#:jg #:jingle))
|
||||||
(:local-nicknames (#:pi #:piccolo))
|
(:local-nicknames (#:pi #:piccolo))
|
||||||
(:local-nicknames (#:cmp #:hp/components/**/*))
|
|
||||||
(:export #:render))
|
(:export #:render))
|
||||||
(in-package #:hp/view)
|
(in-package #:hp/view)
|
||||||
|
|
||||||
(defun render (page &key metadata status)
|
(pi:define-element document (title description)
|
||||||
|
(pi:h
|
||||||
|
(html :lang "ja"
|
||||||
|
(head
|
||||||
|
(meta :charset "UTF-8")
|
||||||
|
(script :src "/scripts/htmx.js")
|
||||||
|
(script :src "/scripts/htmx-ext/head-support.js")
|
||||||
|
(script :src "/scripts/alpine.js" :defer t)
|
||||||
|
(link :rel "stylesheet" :type "text/css" :href "/styles/ress.css")
|
||||||
|
(link :rel "stylesheet" :type "text/css" :href "/styles/global.css")
|
||||||
|
(link :rel "preconnect" :href "https://fonts.googleapis.com")
|
||||||
|
(link :rel "preconnect" :href "https://fonts.gstatic.com" :crossorigin t)
|
||||||
|
(link
|
||||||
|
:rel "stylesheet"
|
||||||
|
:href "https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap")
|
||||||
|
(title (format nil "~@[~a - ~]skyizwhite.dev" title))
|
||||||
|
(meta
|
||||||
|
:name "description"
|
||||||
|
:content (or description "pakuの個人サイト")))
|
||||||
|
(body :hx-ext "head-support"
|
||||||
|
(main pi:children)))))
|
||||||
|
|
||||||
|
(defun render (page &key status metadata)
|
||||||
(jg:with-html-response
|
(jg:with-html-response
|
||||||
(and status (jg:set-response-status status))
|
(and status (jg:set-response-status status))
|
||||||
(pi:elem-str
|
(pi:elem-str (document metadata page))))
|
||||||
(cmp:document metadata
|
|
||||||
(cmp:layout page)))))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue