Cleanup imports and use write-document.
This commit is contained in:
parent
4f6006cfcf
commit
cba6776afd
2 changed files with 8 additions and 5 deletions
|
@ -1,24 +1,26 @@
|
|||
(defpackage :coleslaw-static-pages
|
||||
(:use :cl)
|
||||
(:export #:enable)
|
||||
(:import-from :coleslaw #:content
|
||||
(:import-from :coleslaw #:*config*
|
||||
#:content
|
||||
#:page-url
|
||||
#:find-all
|
||||
#:render
|
||||
#:publish))
|
||||
#:publish
|
||||
#:write-document))
|
||||
|
||||
(in-package :coleslaw-static-pages)
|
||||
|
||||
(defclass page (content)
|
||||
((:url :initarg :url :reader page-url)))
|
||||
((url :initarg :url :reader page-url)))
|
||||
|
||||
(defmethod render ((object page))
|
||||
(defmethod render ((object page) &key next prev)
|
||||
;; For now, we'll re-use the normal post theme.
|
||||
(funcall (theme-fn 'post) (list :config *config*
|
||||
:post object)))
|
||||
|
||||
(defmethod publish ((doc-type (eql (find-class 'page))))
|
||||
(dolist (page (find-all 'page))
|
||||
(write-file (page-path page) (render-page page nil))))
|
||||
(write-document page)))
|
||||
|
||||
(defun enable ())
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#:index
|
||||
#:render-text
|
||||
#:add-injection
|
||||
#:theme-fn
|
||||
;; The Document Protocol
|
||||
#:add-document
|
||||
#:find-all
|
||||
|
|
Loading…
Add table
Reference in a new issue