Fix Mathjax plugin.
This commit is contained in:
parent
bc79620b3a
commit
a1c894c49d
3 changed files with 10 additions and 8 deletions
1
TODO
1
TODO
|
@ -8,6 +8,7 @@ TODO:
|
||||||
; Add SHOUT content type. Add shout indices by month. Twitter\Disqus integration with shouts?
|
; Add SHOUT content type. Add shout indices by month. Twitter\Disqus integration with shouts?
|
||||||
;; needs: shout template or just render function, publish analog for indices of a given ctype?
|
;; needs: shout template or just render function, publish analog for indices of a given ctype?
|
||||||
;; Indices fundamentally don't know about content-types. Is that a problem?
|
;; Indices fundamentally don't know about content-types. Is that a problem?
|
||||||
|
;; Rename index.posts to something else?
|
||||||
0.next
|
0.next
|
||||||
; improve date check/error reporting. -> 0.9
|
; improve date check/error reporting. -> 0.9
|
||||||
; doc themes and plugins, s3+hunchentoot. -> 0.9
|
; doc themes and plugins, s3+hunchentoot. -> 0.9
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
(:use :cl)
|
(:use :cl)
|
||||||
(:export #:enable)
|
(:export #:enable)
|
||||||
(:import-from :coleslaw #:add-injection
|
(:import-from :coleslaw #:add-injection
|
||||||
#:post
|
#:content
|
||||||
#:index
|
#:index
|
||||||
#:post-tags
|
#:content-tags
|
||||||
#:index-posts))
|
#:index-posts))
|
||||||
|
|
||||||
(in-package :coleslaw-mathjax)
|
(in-package :coleslaw-mathjax)
|
||||||
|
@ -21,10 +21,10 @@ src=\"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLor
|
||||||
</script>")
|
</script>")
|
||||||
|
|
||||||
(defun enable ()
|
(defun enable ()
|
||||||
(labels ((math-post-p (post)
|
(labels ((math-post-p (obj)
|
||||||
(member "math" (post-tags post) :test #'string=))
|
(member "math" (content-tags obj) :test #'string=))
|
||||||
(mathjax-p (content)
|
(mathjax-p (obj)
|
||||||
(etypecase content
|
(etypecase obj
|
||||||
(post (math-post-p content))
|
(content (math-post-p obj))
|
||||||
(index (some #'math-post-p (index-posts content))))))
|
(index (some #'math-post-p (index-posts obj))))))
|
||||||
(add-injection (list *mathjax-header* #'mathjax-p) :head)))
|
(add-injection (list *mathjax-header* #'mathjax-p) :head)))
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
(:import-from :closure-template #:compile-template)
|
(:import-from :closure-template #:compile-template)
|
||||||
(:export #:main
|
(:export #:main
|
||||||
#:blog
|
#:blog
|
||||||
|
#:content
|
||||||
#:post
|
#:post
|
||||||
#:index
|
#:index
|
||||||
#:add-injection
|
#:add-injection
|
||||||
|
|
Loading…
Add table
Reference in a new issue