Explorar o código

Add a title and treat static-pages as markdown.

Brit Butler %!s(int64=11) %!d(string=hai) anos
pai
achega
f1abdd5410
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      plugins/static-pages.lisp

+ 8 - 2
plugins/static-pages.lisp

@@ -12,10 +12,16 @@
12 12
 (in-package :coleslaw-static-pages)
13 13
 
14 14
 (defclass page (content)
15
-  ((url :initarg :url :reader page-url)))
15
+  ((title :initarg :title :reader page-title)
16
+   (url :initarg :url :reader page-url)))
17
+
18
+(defmethod initialize-instance :after ((object page) &key)
19
+  ;; Expect all static-pages to be written in Markdown for now.
20
+  (with-accessors ((text content-text)) object
21
+    (setf text (render-text text :md))))
16 22
 
17 23
 (defmethod render ((object page) &key next prev)
18
-  ;; For now, we'll re-use the normal post theme.
24
+  ;; For the time being, we'll re-use the normal post theme.
19 25
   (funcall (theme-fn 'post) (list :config *config*
20 26
                                   :post object)))
21 27