浏览代码

Fix Mathjax plugin.

Brit Butler 12 年之前
父节点
当前提交
a1c894c49d
共有 3 个文件被更改,包括 10 次插入8 次删除
  1. 1 0
      TODO
  2. 8 8
      plugins/mathjax.lisp
  3. 1 0
      src/packages.lisp

+ 1 - 0
TODO

@@ -8,6 +8,7 @@ TODO:
8 8
 ; Add SHOUT content type. Add shout indices by month. Twitter\Disqus integration with shouts?
9 9
 ;; needs: shout template or just render function, publish analog for indices of a given ctype?
10 10
 ;; Indices fundamentally don't know about content-types. Is that a problem?
11
+;; Rename index.posts to something else?
11 12
 0.next
12 13
 ; improve date check/error reporting. -> 0.9
13 14
 ; doc themes and plugins, s3+hunchentoot. -> 0.9

+ 8 - 8
plugins/mathjax.lisp

@@ -2,9 +2,9 @@
2 2
   (:use :cl)
3 3
   (:export #:enable)
4 4
   (:import-from :coleslaw #:add-injection
5
-                          #:post
5
+                          #:content
6 6
                           #:index
7
-                          #:post-tags
7
+                          #:content-tags
8 8
                           #:index-posts))
9 9
 
10 10
 (in-package :coleslaw-mathjax)
@@ -21,10 +21,10 @@ src=\"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLor
21 21
 </script>")
22 22
 
23 23
 (defun enable ()
24
-  (labels ((math-post-p (post)
25
-             (member "math" (post-tags post) :test #'string=))
26
-           (mathjax-p (content)
27
-             (etypecase content
28
-               (post (math-post-p content))
29
-               (index (some #'math-post-p (index-posts content))))))
24
+  (labels ((math-post-p (obj)
25
+             (member "math" (content-tags obj) :test #'string=))
26
+           (mathjax-p (obj)
27
+             (etypecase obj
28
+               (content (math-post-p obj))
29
+               (index (some #'math-post-p (index-posts obj))))))
30 30
     (add-injection (list *mathjax-header* #'mathjax-p) :head)))

+ 1 - 0
src/packages.lisp

@@ -7,6 +7,7 @@
7 7
   (:import-from :closure-template #:compile-template)
8 8
   (:export #:main
9 9
            #:blog
10
+           #:content
10 11
            #:post
11 12
            #:index
12 13
            #:add-injection