2014-04-28 13:15:36 -04:00
|
|
|
(defpackage :coleslaw-static-pages
|
|
|
|
(:use :cl)
|
|
|
|
(:export #:enable)
|
2014-04-28 13:42:44 -04:00
|
|
|
(:import-from :coleslaw #:*config*
|
|
|
|
#:content
|
2014-04-28 13:15:36 -04:00
|
|
|
#:page-url
|
|
|
|
#:find-all
|
|
|
|
#:render
|
2014-04-28 13:42:44 -04:00
|
|
|
#:publish
|
|
|
|
#:write-document))
|
2014-04-28 13:15:36 -04:00
|
|
|
|
|
|
|
(in-package :coleslaw-static-pages)
|
|
|
|
|
|
|
|
(defclass page (content)
|
2014-04-28 13:42:44 -04:00
|
|
|
((url :initarg :url :reader page-url)))
|
2014-04-28 13:15:36 -04:00
|
|
|
|
2014-04-28 13:42:44 -04:00
|
|
|
(defmethod render ((object page) &key next prev)
|
2014-04-28 13:15:36 -04:00
|
|
|
;; 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))
|
2014-04-28 13:42:44 -04:00
|
|
|
(write-document page)))
|
2014-04-28 13:15:36 -04:00
|
|
|
|
|
|
|
(defun enable ())
|