|
@@ -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)))
|