Parcourir la Source

Simplify plugin loader.

Brit Butler il y a 12 ans
Parent
commit
60ad551523
4 fichiers modifiés avec 6 ajouts et 7 suppressions
  1. 1 0
      NEWS.md
  2. 2 2
      examples/multi-site.coleslawrc
  3. 1 1
      examples/single-site.coleslawrc
  4. 2 4
      src/config.lisp

+ 1 - 0
NEWS.md

@@ -1,5 +1,6 @@
1 1
 ## Changes for 0.9 (2013-xx-xx):
2 2
 
3
+* INCOMPATIBLE CHANGE: All :plugins in .coleslawrc must be lists. (i.e. (mathjax) not mathjax)
3 4
 * Add support for analytics via Google.
4 5
 * Add support for Restructured Text via cl-docutils.
5 6
 * Add support for deploying to Amazon S3.

+ 2 - 2
examples/multi-site.coleslawrc

@@ -2,7 +2,7 @@
2 2
                                       :deploy "/home/coleslaw/www/lisp-is-fun/"
3 3
                                       :domain "http://blub.co.za"
4 4
                                       :feeds ("lisp")
5
-                                      :plugins (mathjax)
5
+                                      :plugins ((mathjax))
6 6
                                       :sitenav ((:url "http://twitter.com/ralph_moeritz" :name "Twitter")
7 7
                                                 (:url "http://github.com/ralph-moeritz" :name "Code"))
8 8
                                       :title "(lisp :is 'fun)"
@@ -11,7 +11,7 @@
11 11
                                   :deploy "/home/coleslaw/www/musings/"
12 12
                                   :domain "http://musings.co.za"
13 13
                                   :feeds ("opinion")
14
-                                  :plugins (mathjax)
14
+                                  :plugins ((mathjax))
15 15
                                   :sitenav ((:url "http://twitter.com/ralph_moeritz" :name "Twitter")
16 16
                                             (:url "http://github.com/ralph-moeritz" :name "Code"))
17 17
                                   :title "Musings"

+ 1 - 1
examples/single-site.coleslawrc

@@ -2,7 +2,7 @@
2 2
  :deploy "/home/git/blog/"
3 3
  :domain "http://blog.redlinernotes.com"
4 4
  :feeds ("lisp")
5
- :plugins (mathjax
5
+ :plugins ((mathjax)
6 6
            (disqus :shortname "my-site-name")
7 7
            (analytics :tracking-code "foo"))
8 8
  :repo "/home/git/tmp/improvedmeans/"

+ 2 - 4
src/config.lisp

@@ -33,10 +33,8 @@ are in the plugins folder in coleslaw's source directory."
33 33
   (flet ((plugin-path (sym)
34 34
            (app-path "plugins/~a" (string-downcase (symbol-name sym)))))
35 35
     (dolist (plugin plugins)
36
-      (etypecase plugin
37
-        (list (destructuring-bind (name &rest args) plugin
38
-                (apply 'enable-plugin (plugin-path name) args)))
39
-        (symbol (enable-plugin (plugin-path plugin)))))))
36
+      (destructuring-bind (name &rest args) plugin
37
+        (apply 'enable-plugin (plugin-path name) args)))))
40 38
 
41 39
 (defun load-config (config-key &optional (dir (user-homedir-pathname)))
42 40
   "Load the coleslaw configuration for CONFIG-KEY from DIR/.coleslawrc. DIR is ~ by default."