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