diff --git a/plugins/import.lisp b/plugins/import.lisp index 087657e..eeea58f 100644 --- a/plugins/import.lisp +++ b/plugins/import.lisp @@ -1,4 +1,5 @@ -(ql:quickload '(cxml split-sequence local-time cl-ppcre)) +(eval-when (:compile-toplevel) + (ql:quickload '(cxml split-sequence local-time cl-ppcre))) (defpackage :coleslaw-import (:use :cl :coleslaw :cxml) @@ -52,9 +53,9 @@ object is determined by SERVICE.")) (add-post new-post (post-id new-post)) (when static-p (ensure-directories-exist coleslaw::*input-dir*) - (write-post-file new-post)))))) + (export-post new-post)))))) -(defun write-post-file (post) +(defmethod export-post (post) (let ((filepath (merge-pathnames (format nil "~5,'0d-~a.post" (post-id post) (coleslaw::escape (post-title post))) diff --git a/plugins/mathjax.lisp b/plugins/mathjax.lisp index fb7f3d6..0981893 100644 --- a/plugins/mathjax.lisp +++ b/plugins/mathjax.lisp @@ -1,2 +1,17 @@ -(in-package :coleslaw) +(defpackage :coleslaw-mathjax + (:use :cl :coleslaw)) +(in-package :coleslaw-mathjax) + +(defvar *mathjax-header* " +") + +(defmethod enable () + (coleslaw::add-injection *mathjax-header* :head)) + +(defmethod disable () + (coleslaw::remove-injection *mathjax-header* :head)) diff --git a/src/plugins.lisp b/src/plugins.lisp index 7a087c9..543a637 100644 --- a/src/plugins.lisp +++ b/src/plugins.lisp @@ -2,7 +2,7 @@ (defun load-plugins (plugins) "Resolve the path of each symbol in PLUGINS and call LOAD on the -resulting pathname. It is expected that the matching *.lisp files +resulting pathnames. It is expected that the matching *.lisp files are in the plugins folder in coleslaw's source directory." (let ((files (mapcar (lambda (sym) (merge-pathnames diff --git a/static/posts.lisp b/static/posts.lisp index 517dd5e..c97e95c 100644 --- a/static/posts.lisp +++ b/static/posts.lisp @@ -32,7 +32,7 @@ (loop for tag in (post-tags post) do (remove-from-index (concatenate 'string "tag/" tag) post)) (remove-from-index (concatenate 'string "date/" - (month-year (post-date post))) post) + (year-month (post-date post))) post) (remove-from-index "recent" post) (setf (find-post id) nil)))