diff options
author | Colin Okay <okay@toyful.space> | 2021-05-15 10:48:50 -0500 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2021-05-15 10:48:50 -0500 |
commit | 95b4d94acf92c2c62c05af4e3ad984e02fa6c898 (patch) | |
tree | f6e1f1d430940111f9e5dc63e6492cf03f86b47e | |
parent | c7761c1ef2a00eb6330bb859fb9e7b4ca1b6b207 (diff) |
merging pathnames, lass sheet tweak
-rw-r--r-- | flexo.lisp | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -332,7 +332,7 @@ artifact tables have changed." `(make-instance 'lass-sheet :url ,url - :text (lass:compile-and-write ,@lass-code))) + :text (lass:compile-and-write '(:let () ,@lass-code)))) (defmacro define-lass-sheet (name url &body lass-code) "Defines a thunk named NAME that, when called, creates an instance @@ -402,15 +402,19 @@ artifact tables have changed." (:documentation "Publish the given artifact in the given location.")) (defmethod publish ((artifact file-artifact) (location pathname)) - (uiop:copy-file (filepath artifact) - (uiop:merge-pathnames* (artifact-url-path artifact) location))) + (let ((path (uiop:merge-pathnames* (artifact-url-path artifact) location))) + (ensure-directories-exist path) + (uiop:copy-file (filepath artifact) path))) (defmethod publish ((generated template-generated-text) (location pathname)) - (alexandria:write-string-into-file - (generated-text generated) - (uiop:merge-pathnames* (artifact-url-path generated) location) - :if-exists :supersede - :external-format :utf8)) + (let ((path + (uiop:merge-pathnames* (artifact-url-path generated) location))) + (ensure-directories-exist path) + (alexandria:write-string-into-file + (generated-text generated) + path + :if-exists :supersede + :external-format :utf8))) (defun publish-site (site location) "SITE is a hashtable keyed by url paths whose values are ARTIFACT |