From f1abdd5410c2a9731da357e1fb83d6fa0bc95dc3 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Tue, 29 Apr 2014 00:20:46 -0400 Subject: [PATCH] Add a title and treat static-pages as markdown. --- plugins/static-pages.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/static-pages.lisp b/plugins/static-pages.lisp index 3cf142c..66d276a 100644 --- a/plugins/static-pages.lisp +++ b/plugins/static-pages.lisp @@ -12,10 +12,16 @@ (in-package :coleslaw-static-pages) (defclass page (content) - ((url :initarg :url :reader page-url))) + ((title :initarg :title :reader page-title) + (url :initarg :url :reader page-url))) + +(defmethod initialize-instance :after ((object page) &key) + ;; Expect all static-pages to be written in Markdown for now. + (with-accessors ((text content-text)) object + (setf text (render-text text :md)))) (defmethod render ((object page) &key next prev) - ;; For now, we'll re-use the normal post theme. + ;; For the time being, we'll re-use the normal post theme. (funcall (theme-fn 'post) (list :config *config* :post object)))