Recently Written · git

coleslaw

Emacs mode for the "Coleslaw" site generator written in Common Lisp.

git clone https://github.com/equwal/coleslaw

Log | Files | Refs


plugins/disqus.lisp (1244 bytes)

1 (defpackage :coleslaw-disqus
2   (:use :cl)
3   (:export #:enable)
4   (:import-from :coleslaw #:add-injection
5                           #:post))
6 
7 (in-package :coleslaw-disqus)
8 
9 (defvar *disqus-header*
10   "<div id=\"disqus_thread\"></div>
11      <script type=\"text/javascript\">
12        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
13        var disqus_shortname = '~a';
14        /* * * DON'T EDIT BELOW THIS LINE * * */
15        (function() {
16          var dsq = document.createElement('script');
17          dsq.type = 'text/javascript';
18          dsq.async = true;
19          dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
20          (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
21            })();
22      </script>
23      <noscript>Please enable JavaScript to view the <a href=\"http://disqus.com/?ref_noscript\">comments powered by Disqus.</a></noscript>
24      <a href=\"http://disqus.com\" class=\"dsq-brlink\">comments powered by <span class=\"logo-disqus\">Disqus</span></a>")
25 
26 (defun enable (&key shortname)
27   (flet ((inject-p (x)
28            (when (typep x 'post)
29              (format nil *disqus-header* shortname))))
30     (add-injection #'inject-p :body)))