website/src/view/components/document/scripts.lisp

37 lines
967 B
Common Lisp
Raw Normal View History

2024-04-22 06:37:20 +09:00
(defpackage #:hp/view/components/document/scripts
(:use #:cl)
(:local-nicknames (#:pi #:piccolo))
(:import-from #:hp/view/asset
2024-04-24 00:09:04 +09:00
#:defasset)
2024-04-22 06:37:20 +09:00
(:export #:scripts))
(in-package #:hp/view/components/document/scripts)
2024-04-24 00:39:08 +09:00
(defasset *htmx* :vendor "htmx@1.9.12.js")
(defasset *htmx-exts* :htmx-ext
("alpine-morph@1.9.12.js"
"head-support@1.9.12.js"))
2024-04-22 06:37:20 +09:00
2024-04-24 00:39:08 +09:00
(defasset *alpine* :vendor "alpine@3.13.8.js")
(defasset *alpine-exts* :alpine-ext
("async-alpine@1.2.2.js"
"persist@3.13.8.js"
"morph@3.13.8.js"))
2024-04-22 06:37:20 +09:00
2024-04-24 00:39:08 +09:00
(defasset *global* :js "global.js")
2024-04-22 06:37:20 +09:00
(pi:define-element extentions (paths defer)
(pi:h
(<>
(mapcar (lambda (path)
(script :src path :defer defer))
paths))))
(pi:define-element scripts ()
(pi:h
(<>
(script :src *htmx*)
2024-04-24 00:39:08 +09:00
(extentions :paths *htmx-exts*)
(extentions :paths *alpine-exts* :defer t)
(script :src *global* :defer t)
2024-04-22 06:37:20 +09:00
(script :src *alpine* :defer t))))