Update about page

This commit is contained in:
Akira Tempaku 2025-05-17 00:38:08 +09:00
parent 3fae8f8320
commit 9acec8bbe2
Signed by: paku
GPG key ID: 5B4E8402BCC50607
6 changed files with 52 additions and 43 deletions

View file

@ -13,11 +13,24 @@
(defparameter *metadata*
(list :title "about"))
(defcomp ~page ()
(hsx
(p "coming soon")))
(defun handle-get (params)
(declare (ignore params))
(setf (context :metadata) *metadata*)
(~page))
(with-request-params ((draft-key "draft-key" nil)) params
(let ((about (get-about :query (list :draft-key draft-key))))
(hsx
(<>
(and draft-key (hsx (p :class "text-lg text-pink-500" "下書きモード")))
(article :class "prose max-w-none"
(h1 "About")
(div :class "flex justify-center"
(figure :class "flex flex-col items-center"
(img
:src (getf (getf about :avatar) :url)
:alt "avatar" :class "size-40 rounded-xl shadow-sm avatar")
(figcaption (getf about :avatar-caption))))
(raw! (getf about :content))
(p :class "text-right"
"(最終更新:"
(|time| :datetime (datetime (getf about :revised-at))
(jp-datetime (getf about :revised-at)))
"")))))))

View file

@ -8,11 +8,7 @@
(defparameter *metadata*
(list :title "blog"))
(defcomp ~page ()
(hsx
(p "coming soon")))
(defun handle-get (params)
(declare (ignore params))
(setf (context :metadata) *metadata*)
(~page))
(hsx (p "coming soon")))

View file

@ -1,6 +1,8 @@
(defpackage #:website/routes/index
(:use #:cl
#:hsx)
(:import-from #:website/lib/cms
#:get-about)
(:export #:handle-get
#:handle-head))
(in-package #:website/routes/index)
@ -22,29 +24,29 @@
"https://status.skyizwhite.dev"
"/img/icon/server.svg")))
(defcomp ~page ()
(hsx
(div :class "flex flex-col items-center justify-center h-full"
(img :src "/img/avatar.webp" :alt "avatar" :class "size-40 rounded-xl shadow-sm")
(div :class "flex flex-col items-center gap-2 py-6"
(h1 :class "font-bold text-2xl text-center"
"Akira Tempaku")
(p :class "text-xl"
"Web developer"))
(div :class "flex flex-col gap-2 items-left"
(loop
:for (name url icon) :in *links*
:collect (hsx (a
:href url
:target "_blank"
:class "flex items-center gap-2 text-lg hover:text-pink-500"
:rel "me"
(img :src icon :alt name :class "size-4 mt-1")
(span name))))))))
(defun handle-get (params)
(declare (ignore params))
(~page))
(let ((about (get-about :query '(:fields "avatar"))))
(hsx
(div :class "flex flex-col items-center justify-center h-full"
(img
:src (getf (getf about :avatar) :url)
:alt "avatar" :class "size-40 rounded-xl shadow-sm avatar")
(div :class "flex flex-col items-center gap-2 py-6"
(h1 :class "font-bold text-2xl text-center"
"Akira Tempaku")
(p :class "text-xl"
"Web developer"))
(div :class "flex flex-col gap-2 items-left"
(loop
:for (name url icon) :in *links*
:collect (hsx (a
:href url
:target "_blank"
:class "flex items-center gap-2 text-lg hover:text-pink-500"
:rel "me"
(img :src icon :alt name :class "size-4 mt-1")
(span name)))))))))
; for health check
(defun handle-head (params)

View file

@ -10,14 +10,11 @@
:description "The page you are looking for may have been deleted or the URL might be incorrect."
:error t))
(defcomp ~page ()
(defun handle-not-found ()
(setf (context :metadata) *metadata*)
(hsx
(div :class "flex flex-col h-full items-center justify-center gap-y-6"
(h1 :class "font-bold text-2xl"
"404 Not Found")
(a :href "/" :class "text-lg text-pink-500 hover:underline"
"Back to TOP"))))
(defun handle-not-found ()
(setf (context :metadata) *metadata*)
(~page))

View file

@ -13,11 +13,7 @@
(defparameter *metadata*
(list :title "work"))
(defcomp ~page ()
(hsx
(p "coming soon")))
(defun handle-get (params)
(declare (ignore params))
(setf (context :metadata) *metadata*)
(~page))
(hsx (p "coming soon")))

View file

@ -26,4 +26,9 @@
@view-transition {
navigation: auto;
}
}
.avatar {
view-transition-name: avatar;
contain: paint;
}