Sfoglia il codice sorgente

added support for isso: http://posativ.org/isso/

Cthulhux 9 anni fa
parent
commit
b94267a6f6
1 ha cambiato i file con 20 aggiunte e 0 eliminazioni
  1. 20 0
      plugins/isso.lisp

+ 20 - 0
plugins/isso.lisp

@@ -0,0 +1,20 @@
1
+(defpackage :coleslaw-isso
2
+  (:use :cl)
3
+  (:export #:enable)
4
+  (:import-from :coleslaw #:add-injection
5
+                          #:post))
6
+
7
+(in-package :coleslaw-isso)
8
+
9
+(defvar *isso-header*
10
+  "<div class=\"comments\">
11
+      <section id=\"isso-thread\"></section>
12
+      <script data-isso=\"~a/\"
13
+              src=\"~a/js/embed.min.js\"></script>
14
+    </div>")
15
+
16
+(defun enable (&key isso-url)
17
+  (flet ((inject-p (x)
18
+           (when (typep x 'post)
19
+             (format nil *isso-header* isso-url))))
20
+    (add-injection #'inject-p :body)))