소스 검색

Minor cleanups.

Brit Butler 12 년 전
부모
커밋
a2cd3c1cda
5개의 변경된 파일22개의 추가작업 그리고 19개의 파일을 삭제
  1. 8 0
      TODO
  2. 3 2
      plugins/s3.lisp
  3. 1 0
      src/packages.lisp
  4. 1 8
      src/themes.lisp
  5. 9 9
      src/util.lisp

+ 8 - 0
TODO

@@ -16,3 +16,11 @@ Coleslaw.next
16 16
 ; unit tests
17 17
 ; Incremental compilation: only "touched" posts+tags+months and by-n. -> 1.0
18 18
 
19
+;; DOCUMENTATION
20
+;; A theme directory should be named after the theme and contain *.tmpl files
21
+;; that define the following functions in a coleslaw.theme.$NAME namespace.
22
+;; Required templates:
23
+;; {template base}
24
+;; {template post}
25
+;; {template index}
26
+

+ 3 - 2
plugins/s3.lisp

@@ -3,7 +3,8 @@
3 3
 
4 4
 (defpackage :coleslaw-s3
5 5
   (:use :cl :zs3)
6
-  (:import-from :coleslaw #:deploy)
6
+  (:import-from :coleslaw #:deploy
7
+                          #:*config*)
7 8
   (:import-from :zs3 #:all-keys
8 9
                      #:etag
9 10
                      #:file-etag
@@ -48,7 +49,7 @@ and the secret key on the second.")
48 49
     (cl-fad:walk-directory dir #'upload)))
49 50
 
50 51
 (defmethod deploy :after (staging)
51
-  (let ((blog (deploy coleslaw::*config*)))
52
+  (let ((blog (deploy *config*)))
52 53
     (loop for key across (all-keys *bucket*)
53 54
        do (setf (gethash (etag key) *cache*) key))
54 55
     (dir->s3 blog)

+ 1 - 0
src/packages.lisp

@@ -7,6 +7,7 @@
7 7
                             #:compose)
8 8
   (:import-from :closure-template #:compile-template)
9 9
   (:export #:main
10
+           #:*config*
10 11
            #:blog
11 12
            #:content
12 13
            #:post

+ 1 - 8
src/themes.lisp

@@ -14,6 +14,7 @@ any return value other than nil indicates the injection should be added."
14 14
     (push result (getf *injections* location))))
15 15
 
16 16
 (defun find-injections (content)
17
+  "Iterate over *INJECTIONS* collecting any that should be added to CONTENT."
17 18
   (flet ((injections-for (location)
18 19
            (loop for (injection predicate) in (getf *injections* location)
19 20
               when (funcall predicate content)
@@ -35,11 +36,3 @@ any return value other than nil indicates the injection should be added."
35 36
     (compile-template :common-lisp-backend file))
36 37
   (do-files (file (app-path "themes/") "tmpl")
37 38
     (compile-template :common-lisp-backend file)))
38
-
39
-;; DOCUMENTATION
40
-;; A theme directory should be named after the theme and contain *.tmpl files
41
-;; that define the following functions in a coleslaw.theme.$NAME namespace.
42
-;; Required templates:
43
-;; {template base}
44
-;; {template post}
45
-;; {template index}

+ 9 - 9
src/util.lisp

@@ -29,6 +29,15 @@ on files that match the given extension."
29 29
                    ,@body)))
30 30
              `,body))))
31 31
 
32
+(defun exit ()
33
+  "Exit the lisp system returning a 0 status code."
34
+  #+sbcl (sb-ext:quit)
35
+  #+ccl (ccl:quit)
36
+  #+ecl (si:quit)
37
+  #+cmucl (ext:quit)
38
+  #+clisp (ext:quit)
39
+  #-(or sbcl ccl ecl cmucl clisp) (error "Not implemented yet."))
40
+
32 41
 (defun current-directory ()
33 42
   "Return the operating system's current directory."
34 43
   #+sbcl (sb-posix:getcwd)
@@ -47,15 +56,6 @@ on files that match the given extension."
47 56
   #+clisp (ext:cd path)
48 57
   #-(or sbcl ccl ecl cmucl clisp) (error "Not implemented yet."))
49 58
 
50
-(defun exit ()
51
-  "Exit the lisp system returning a 0 status code."
52
-  #+sbcl (sb-ext:quit)
53
-  #+ccl (ccl:quit)
54
-  #+ecl (si:quit)
55
-  #+cmucl (ext:quit)
56
-  #+clisp (ext:quit)
57
-  #-(or sbcl ccl ecl clisp) (error "Not implemented yet."))
58
-
59 59
 (defmacro with-current-directory (path &body body)
60 60
   "Change the current OS directory to PATH and execute BODY in
61 61
 an UNWIND-PROTECT, then change back to the current directory."