oxaliq.net/source/post-footer.scm
sorrel 4982e32350 change .txt to .scm in source files
allows git forge to recognize source as sexprs
2024-01-21 17:56:40 -05:00

39 lines
No EOL
1.2 KiB
Scheme

(lambda (tag-list history-list)
(let ([class-sec `(ul ((class "tag-list")))])
`(footer
(section
(h5 "tagged")
,(begin
(for-each
(lambda (tag)
(set! class-sec
(append class-sec
;; append unwraps one layer of list, hence (( ... ))
`((li
((class "tag-item"))
(span
((class "hx-target"))
(a ((href ,(string-append "/tagged/" tag))
(hx-get ,(string-append "/hx/tagged/" tag))
(hx-target "closest span.hx-target")
(hx-swap "innerHTML"))
,tag)))))))
tag-list)
class-sec))
(hr)
(p
((class "doc-history"))
(small
,(foldr
(lambda (history acc)
(if (non-empty-string? acc)
(string-append acc "modified: " (~a history) "\n")
(string-append acc "published: " (~a history))))
""
history-list)))
(p
((class "license-info"))
(small
(a
((href "/license"))
"license"))))))