diff --git a/src/app.lisp b/src/app.lisp index e447261..af18ab7 100644 --- a/src/app.lisp +++ b/src/app.lisp @@ -3,7 +3,7 @@ (:use #:cl) (:local-nicknames (#:jg #:jingle)) (:local-nicknames (#:fbr #:ningle-fbr)) - (:local-nicknames (#:cfg #:hp/config/*)) + (:local-nicknames (#:cfg #:hp/config/env)) (:local-nicknames (#:asset #:hp/view/asset)) (:local-nicknames (#:mw #:hp/middlewares/*)) (:export #:start diff --git a/src/config/asset.lisp b/src/config/asset.lisp new file mode 100644 index 0000000..153159b --- /dev/null +++ b/src/config/asset.lisp @@ -0,0 +1,12 @@ +(defpackage #:hp/config/asset + (:use #:cl) + (:export #:*asset-roots*)) +(in-package #:hp/config/asset) + +(defparameter *asset-roots* + '(:img "/img/" + :css "/css/" + :js "/js/" + :vendor "/vendor/" + :htmx-ext "/vendor/htmx-ext/" + :alpine-ext "/vendor/alpine-ext/")) diff --git a/src/routes/about.lisp b/src/routes/about.lisp index c46df27..76e2e7d 100644 --- a/src/routes/about.lisp +++ b/src/routes/about.lisp @@ -1,7 +1,7 @@ (defpackage #:hp/routes/about (:use #:cl) (:local-nicknames (#:pi #:piccolo)) - (:local-nicknames (#:view #:hp/view/**/*)) + (:local-nicknames (#:view #:hp/view/*)) (:export #:handle-get)) (in-package #:hp/routes/about) diff --git a/src/routes/index.lisp b/src/routes/index.lisp index ef9bacc..c565483 100644 --- a/src/routes/index.lisp +++ b/src/routes/index.lisp @@ -1,7 +1,7 @@ (defpackage #:hp/routes/index (:use #:cl) (:local-nicknames (#:pi #:piccolo)) - (:local-nicknames (#:view #:hp/view/**/*)) + (:local-nicknames (#:view #:hp/view/*)) (:export #:handle-get)) (in-package #:hp/routes/index) diff --git a/src/routes/not-found.lisp b/src/routes/not-found.lisp index 0ee48d9..f6c7f31 100644 --- a/src/routes/not-found.lisp +++ b/src/routes/not-found.lisp @@ -2,7 +2,7 @@ (:use #:cl) (:local-nicknames (#:jg #:jingle)) (:local-nicknames (#:pi #:piccolo)) - (:local-nicknames (#:view #:hp/view/**/*)) + (:local-nicknames (#:view #:hp/view/*)) (:export #:handle-not-found)) (in-package #:hp/routes/not-found) diff --git a/src/view/asset.lisp b/src/view/asset.lisp index 4e3d98e..22fe2d0 100644 --- a/src/view/asset.lisp +++ b/src/view/asset.lisp @@ -1,21 +1,15 @@ (defpackage #:hp/view/asset (:use #:cl) (:local-nicknames (#:re #:cl-ppcre)) + (:local-nicknames (#:cfg #:hp/config/asset)) (:export #:asset-root #:define-assets #:get-css-paths #:cmp-props)) (in-package #:hp/view/asset) -(defparameter *asset-roots* - '(:css "/css/" - :js "/js/" - :vendor "/vendor/" - :htmx-ext "/vendor/htmx-ext/" - :alpine-ext "/vendor/alpine-ext/")) - (defun asset-root (kind) - (getf *asset-roots* kind)) + (getf cfg:*asset-roots* kind)) (defun asset-path (kind path) (concatenate 'string (asset-root kind) path))