Add ~article component
This commit is contained in:
parent
631d979faf
commit
adbf730cf7
3 changed files with 36 additions and 30 deletions
src/components
21
src/components/article.lisp
Normal file
21
src/components/article.lisp
Normal 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))
|
||||
")")))))
|
Loading…
Add table
Add a link
Reference in a new issue