Add header
This commit is contained in:
parent
23bacbbe41
commit
5a0e0016e9
4 changed files with 36 additions and 18 deletions
1
qlfile
1
qlfile
|
@ -6,3 +6,4 @@ git ningle-fbr https://github.com/skyizwhite/ningle-fbr.git
|
||||||
ql cl-ppcre
|
ql cl-ppcre
|
||||||
ql trivial-backtrace
|
ql trivial-backtrace
|
||||||
ql trivia
|
ql trivia
|
||||||
|
ql cl-str
|
||||||
|
|
|
@ -34,3 +34,7 @@
|
||||||
(:class qlot/source/ql:source-ql
|
(:class qlot/source/ql:source-ql
|
||||||
:initargs (:%version :latest)
|
:initargs (:%version :latest)
|
||||||
:version "ql-2024-10-12"))
|
:version "ql-2024-10-12"))
|
||||||
|
("cl-str" .
|
||||||
|
(:class qlot/source/ql:source-ql
|
||||||
|
:initargs (:%version :latest)
|
||||||
|
:version "ql-2024-10-12"))
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
(:use #:cl
|
(:use #:cl
|
||||||
#:hsx
|
#:hsx
|
||||||
#:trivia)
|
#:trivia)
|
||||||
|
(:import-from #:str)
|
||||||
(:local-nicknames (#:jg #:jingle))
|
(:local-nicknames (#:jg #:jingle))
|
||||||
(:import-from #:hsx/element
|
(:import-from #:hsx/element
|
||||||
#:element)
|
#:element)
|
||||||
|
@ -11,6 +12,25 @@
|
||||||
(defun bust-cache (url)
|
(defun bust-cache (url)
|
||||||
(format nil "~a?~a" url #.(get-universal-time)))
|
(format nil "~a?~a" url #.(get-universal-time)))
|
||||||
|
|
||||||
|
(defcomp page-header ()
|
||||||
|
(let ((links '(("Work" "/work")
|
||||||
|
("Blog" "/blog"))))
|
||||||
|
(hsx
|
||||||
|
(header :class "flex justify-between container mx-auto py-4"
|
||||||
|
(h1 :class "text-lg font-bold"
|
||||||
|
(a :href "/" "skyizwhite"))
|
||||||
|
(ul :class "flex"
|
||||||
|
(loop
|
||||||
|
:for (content href) :in links :collect
|
||||||
|
(li (a
|
||||||
|
:href href
|
||||||
|
:class (concatenate 'string
|
||||||
|
"pl-4"
|
||||||
|
(and (str:starts-with? href
|
||||||
|
(jg:request-uri jg:*request*))
|
||||||
|
" text-pink-600"))
|
||||||
|
content))))))))
|
||||||
|
|
||||||
(defcomp document (&key title description children)
|
(defcomp document (&key title description children)
|
||||||
(hsx
|
(hsx
|
||||||
(html :lang "ja"
|
(html :lang "ja"
|
||||||
|
@ -24,12 +44,14 @@
|
||||||
(script :src "https://cdn.jsdelivr.net/npm/htmx-ext-head-support@2.0.0/head-support.min.js")
|
(script :src "https://cdn.jsdelivr.net/npm/htmx-ext-head-support@2.0.0/head-support.min.js")
|
||||||
(script :src "https://cdn.jsdelivr.net/npm/htmx-ext-response-targets@2.0.0/response-targets.min.js")
|
(script :src "https://cdn.jsdelivr.net/npm/htmx-ext-response-targets@2.0.0/response-targets.min.js")
|
||||||
(script :src "https://cdn.jsdelivr.net/npm/alpinejs@3.14.0/dist/cdn.min.js" :defer t)
|
(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" title))
|
||||||
(meta
|
(meta :name "description" :content (or description "pakuの個人サイト")))
|
||||||
:name "description"
|
(body
|
||||||
:content (or description "pakuの個人サイト")))
|
:hx-ext "head-support, response-targets"
|
||||||
(body :hx-ext "head-support, response-targets" :hx-target-404 "body"
|
:hx-boost "true" :hx-target-404 "body" :hx-target-5* "body"
|
||||||
(main :class "container mx-auto"
|
:class "h-[100svh] flex flex-col"
|
||||||
|
(page-header)
|
||||||
|
(main :class "flex-1 h-full mx-auto container"
|
||||||
children)))))
|
children)))))
|
||||||
|
|
||||||
(defmethod jg:process-response ((app jg:app) result)
|
(defmethod jg:process-response ((app jg:app) result)
|
||||||
|
|
|
@ -6,18 +6,9 @@
|
||||||
|
|
||||||
(defcomp page ()
|
(defcomp page ()
|
||||||
(hsx
|
(hsx
|
||||||
(<>
|
(div :class "h-full grid place-items-center"
|
||||||
(h1 :class "text-green-600"
|
(h1 :class "text-pink-600"
|
||||||
"こんにちは")
|
"Hello World"))))
|
||||||
(div :x-data "{
|
|
||||||
open: false,
|
|
||||||
get isOpen() { return this.open },
|
|
||||||
toggle() { this.open = ! this.open },
|
|
||||||
}"
|
|
||||||
(button :@click "toggle()"
|
|
||||||
"Toggle")
|
|
||||||
(div :x-show "isOpen"
|
|
||||||
"Content ...")))))
|
|
||||||
|
|
||||||
(defun handle-get (params)
|
(defun handle-get (params)
|
||||||
(declare (ignore params))
|
(declare (ignore params))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue