ソースを参照

Merge pull request #101 from ljanyst/user-plugins

Allow plug-ins to be defined in the user repo
Brit Butler 9 年 前
コミット
9819c279bb
共有2 個のファイルを変更した11 個の追加1 個の削除を含む
  1. 3 1
      src/config.lisp
  2. 8 0
      src/packages.lisp

+ 3 - 1
src/config.lisp

@@ -49,7 +49,9 @@
49 49
 (defun enable-plugin (name args)
50 50
   "Given a plugin, NAME, compile+load it and call its ENABLE function with ARGS."
51 51
   (flet ((plugin-path (sym)
52
-           (app-path "plugins/~(~A~)" sym))
52
+           (if (probe-file (repo-path "plugins/~(~A~).lisp" sym))
53
+               (repo-path "plugins/~(~A~)" sym)
54
+               (app-path "plugins/~(~A~)" sym)))
53 55
          (plugin-package (sym)
54 56
            (format nil "~:@(coleslaw-~A~)" sym)))
55 57
     (let ((file (plugin-path name)))

+ 8 - 0
src/packages.lisp

@@ -13,6 +13,14 @@
13 13
   (:export #:main
14 14
            #:preview
15 15
            #:*config*
16
+           ;; Config Accessors
17
+           #:author
18
+           #:deploy-dir
19
+           #:domain
20
+           #:page-ext
21
+           #:repo-dir
22
+           #:staging-dir
23
+           #:title
16 24
            ;; Core Classes
17 25
            #:content
18 26
            #:post