Browse Source

Cleanup imports and use write-document.

Brit Butler 11 years ago
parent
commit
cba6776afd
2 changed files with 8 additions and 5 deletions
  1. 7 5
      plugins/static-pages.lisp
  2. 1 0
      src/packages.lisp

+ 7 - 5
plugins/static-pages.lisp

1
 (defpackage :coleslaw-static-pages
1
 (defpackage :coleslaw-static-pages
2
   (:use :cl)
2
   (:use :cl)
3
   (:export #:enable)
3
   (:export #:enable)
4
-  (:import-from :coleslaw #:content
4
+  (:import-from :coleslaw #:*config*
5
+                          #:content
5
                           #:page-url
6
                           #:page-url
6
                           #:find-all
7
                           #:find-all
7
                           #:render
8
                           #:render
8
-                          #:publish))
9
+                          #:publish
10
+                          #:write-document))
9
 
11
 
10
 (in-package :coleslaw-static-pages)
12
 (in-package :coleslaw-static-pages)
11
 
13
 
12
 (defclass page (content)
14
 (defclass page (content)
13
-  ((:url :initarg :url :reader page-url)))
15
+  ((url :initarg :url :reader page-url)))
14
 
16
 
15
-(defmethod render ((object page))
17
+(defmethod render ((object page) &key next prev)
16
   ;; For now, we'll re-use the normal post theme.
18
   ;; For now, we'll re-use the normal post theme.
17
   (funcall (theme-fn 'post) (list :config *config*
19
   (funcall (theme-fn 'post) (list :config *config*
18
                                   :post object)))
20
                                   :post object)))
19
 
21
 
20
 (defmethod publish ((doc-type (eql (find-class 'page))))
22
 (defmethod publish ((doc-type (eql (find-class 'page))))
21
   (dolist (page (find-all 'page))
23
   (dolist (page (find-all 'page))
22
-    (write-file (page-path page) (render-page page nil))))
24
+    (write-document page)))
23
 
25
 
24
 (defun enable ())
26
 (defun enable ())

+ 1 - 0
src/packages.lisp

15
            #:index
15
            #:index
16
            #:render-text
16
            #:render-text
17
            #:add-injection
17
            #:add-injection
18
+           #:theme-fn
18
            ;; The Document Protocol
19
            ;; The Document Protocol
19
            #:add-document
20
            #:add-document
20
            #:find-all
21
            #:find-all