Add ~article component

This commit is contained in:
Akira Tempaku 2025-05-18 18:27:58 +09:00
commit adbf730cf7
Signed by: paku
GPG key ID: 5B4E8402BCC50607
3 changed files with 36 additions and 30 deletions
src/components

View file

@ -0,0 +1,21 @@
(defpackage #:website/components/article
(:use #:cl
#:hsx)
(:import-from #:website/lib/time
#:datetime
#:jp-datetime)
(:export #:~article))
(in-package #:website/components/article)
(defcomp ~article (&key title content revised-at draft-p)
(hsx
(<>
(and draft-p (hsx (p :class "text-lg text-pink-500" "下書きモード")))
(article :class "prose max-w-none"
(h1 title)
(raw! content)
(p :class "text-right"
"(最終更新:"
(|time| :datetime (datetime revised-at)
(jp-datetime revised-at))
"")))))