website/src/components/article.lisp

22 lines
613 B
Common Lisp
Raw Normal View History

2025-05-18 18:27:58 +09:00
(defpackage #:website/components/article
(:use #:cl
#:hsx)
(:import-from #:website/lib/time
#:datetime
2025-05-18 23:34:03 +09:00
#:asctime)
2025-05-18 18:27:58 +09:00
(:export #:~article))
(in-package #:website/components/article)
(defcomp ~article (&key title content revised-at draft-p)
(hsx
(<>
2025-05-18 23:34:03 +09:00
(and draft-p (hsx (p :class "text-lg text-pink-500" "Draft Mode")))
2025-05-18 18:27:58 +09:00
(article :class "prose max-w-none"
(h1 title)
(raw! content)
(p :class "text-right"
2025-05-18 23:34:03 +09:00
"(Last updated: "
2025-05-18 18:27:58 +09:00
(|time| :datetime (datetime revised-at)
2025-05-18 23:34:03 +09:00
(asctime revised-at))
")")))))