Minor cleanups.
This commit is contained in:
parent
c706964880
commit
a2cd3c1cda
5 changed files with 22 additions and 19 deletions
8
TODO
8
TODO
|
@ -16,3 +16,11 @@ Coleslaw.next
|
||||||
; unit tests
|
; unit tests
|
||||||
; Incremental compilation: only "touched" posts+tags+months and by-n. -> 1.0
|
; Incremental compilation: only "touched" posts+tags+months and by-n. -> 1.0
|
||||||
|
|
||||||
|
;; DOCUMENTATION
|
||||||
|
;; A theme directory should be named after the theme and contain *.tmpl files
|
||||||
|
;; that define the following functions in a coleslaw.theme.$NAME namespace.
|
||||||
|
;; Required templates:
|
||||||
|
;; {template base}
|
||||||
|
;; {template post}
|
||||||
|
;; {template index}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
|
|
||||||
(defpackage :coleslaw-s3
|
(defpackage :coleslaw-s3
|
||||||
(:use :cl :zs3)
|
(:use :cl :zs3)
|
||||||
(:import-from :coleslaw #:deploy)
|
(:import-from :coleslaw #:deploy
|
||||||
|
#:*config*)
|
||||||
(:import-from :zs3 #:all-keys
|
(:import-from :zs3 #:all-keys
|
||||||
#:etag
|
#:etag
|
||||||
#:file-etag
|
#:file-etag
|
||||||
|
@ -48,7 +49,7 @@ and the secret key on the second.")
|
||||||
(cl-fad:walk-directory dir #'upload)))
|
(cl-fad:walk-directory dir #'upload)))
|
||||||
|
|
||||||
(defmethod deploy :after (staging)
|
(defmethod deploy :after (staging)
|
||||||
(let ((blog (deploy coleslaw::*config*)))
|
(let ((blog (deploy *config*)))
|
||||||
(loop for key across (all-keys *bucket*)
|
(loop for key across (all-keys *bucket*)
|
||||||
do (setf (gethash (etag key) *cache*) key))
|
do (setf (gethash (etag key) *cache*) key))
|
||||||
(dir->s3 blog)
|
(dir->s3 blog)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#:compose)
|
#:compose)
|
||||||
(:import-from :closure-template #:compile-template)
|
(:import-from :closure-template #:compile-template)
|
||||||
(:export #:main
|
(:export #:main
|
||||||
|
#:*config*
|
||||||
#:blog
|
#:blog
|
||||||
#:content
|
#:content
|
||||||
#:post
|
#:post
|
||||||
|
|
|
@ -14,6 +14,7 @@ any return value other than nil indicates the injection should be added."
|
||||||
(push result (getf *injections* location))))
|
(push result (getf *injections* location))))
|
||||||
|
|
||||||
(defun find-injections (content)
|
(defun find-injections (content)
|
||||||
|
"Iterate over *INJECTIONS* collecting any that should be added to CONTENT."
|
||||||
(flet ((injections-for (location)
|
(flet ((injections-for (location)
|
||||||
(loop for (injection predicate) in (getf *injections* location)
|
(loop for (injection predicate) in (getf *injections* location)
|
||||||
when (funcall predicate content)
|
when (funcall predicate content)
|
||||||
|
@ -35,11 +36,3 @@ any return value other than nil indicates the injection should be added."
|
||||||
(compile-template :common-lisp-backend file))
|
(compile-template :common-lisp-backend file))
|
||||||
(do-files (file (app-path "themes/") "tmpl")
|
(do-files (file (app-path "themes/") "tmpl")
|
||||||
(compile-template :common-lisp-backend file)))
|
(compile-template :common-lisp-backend file)))
|
||||||
|
|
||||||
;; DOCUMENTATION
|
|
||||||
;; A theme directory should be named after the theme and contain *.tmpl files
|
|
||||||
;; that define the following functions in a coleslaw.theme.$NAME namespace.
|
|
||||||
;; Required templates:
|
|
||||||
;; {template base}
|
|
||||||
;; {template post}
|
|
||||||
;; {template index}
|
|
||||||
|
|
|
@ -29,6 +29,15 @@ on files that match the given extension."
|
||||||
,@body)))
|
,@body)))
|
||||||
`,body))))
|
`,body))))
|
||||||
|
|
||||||
|
(defun exit ()
|
||||||
|
"Exit the lisp system returning a 0 status code."
|
||||||
|
#+sbcl (sb-ext:quit)
|
||||||
|
#+ccl (ccl:quit)
|
||||||
|
#+ecl (si:quit)
|
||||||
|
#+cmucl (ext:quit)
|
||||||
|
#+clisp (ext:quit)
|
||||||
|
#-(or sbcl ccl ecl cmucl clisp) (error "Not implemented yet."))
|
||||||
|
|
||||||
(defun current-directory ()
|
(defun current-directory ()
|
||||||
"Return the operating system's current directory."
|
"Return the operating system's current directory."
|
||||||
#+sbcl (sb-posix:getcwd)
|
#+sbcl (sb-posix:getcwd)
|
||||||
|
@ -47,15 +56,6 @@ on files that match the given extension."
|
||||||
#+clisp (ext:cd path)
|
#+clisp (ext:cd path)
|
||||||
#-(or sbcl ccl ecl cmucl clisp) (error "Not implemented yet."))
|
#-(or sbcl ccl ecl cmucl clisp) (error "Not implemented yet."))
|
||||||
|
|
||||||
(defun exit ()
|
|
||||||
"Exit the lisp system returning a 0 status code."
|
|
||||||
#+sbcl (sb-ext:quit)
|
|
||||||
#+ccl (ccl:quit)
|
|
||||||
#+ecl (si:quit)
|
|
||||||
#+cmucl (ext:quit)
|
|
||||||
#+clisp (ext:quit)
|
|
||||||
#-(or sbcl ccl ecl clisp) (error "Not implemented yet."))
|
|
||||||
|
|
||||||
(defmacro with-current-directory (path &body body)
|
(defmacro with-current-directory (path &body body)
|
||||||
"Change the current OS directory to PATH and execute BODY in
|
"Change the current OS directory to PATH and execute BODY in
|
||||||
an UNWIND-PROTECT, then change back to the current directory."
|
an UNWIND-PROTECT, then change back to the current directory."
|
||||||
|
|
Loading…
Add table
Reference in a new issue