Add Analytics plugin, extend example coleslawrc.

This commit is contained in:
Brit Butler 2013-01-14 12:29:28 -05:00
parent 7024377cad
commit f2fa130527
3 changed files with 27 additions and 2 deletions

View file

@ -17,6 +17,7 @@ Coleslaw aims to be flexible blog software suitable for replacing a single-user
* [Multi-site publishing](http://blub.co.za/posts/Adding-multi-site-support-to-Coleslaw.html) support. * [Multi-site publishing](http://blub.co.za/posts/Adding-multi-site-support-to-Coleslaw.html) support.
* Plugins for... * Plugins for...
* Comments via Disqus * Comments via Disqus
* Analytics via Google
* Using LaTeX (inside pairs of $$) via Mathjax * Using LaTeX (inside pairs of $$) via Mathjax
* Importing posts from wordpress * Importing posts from wordpress
* There is also a [Heroku buildpack](https://github.com/jsmpereira/coleslaw-heroku) maintained by Jose Pereira. * There is also a [Heroku buildpack](https://github.com/jsmpereira/coleslaw-heroku) maintained by Jose Pereira.

View file

@ -2,7 +2,9 @@
:deploy "/home/git/blog/" :deploy "/home/git/blog/"
:domain "http://blog.redlinernotes.com" :domain "http://blog.redlinernotes.com"
:feeds ("lisp") :feeds ("lisp")
:plugins (mathjax) :plugins (mathjax
(disqus :shortname "my-site-name")
(analytics :tracking-code "foo"))
:repo "/home/git/tmp/improvedmeans/" :repo "/home/git/tmp/improvedmeans/"
:sitenav ((:url "http://redlinernotes.com/" :name "Home") :sitenav ((:url "http://redlinernotes.com/" :name "Home")
(:url "http://twitter.com/redline6561" :name "Twitter") (:url "http://twitter.com/redline6561" :name "Twitter")

View file

@ -1,2 +1,24 @@
(in-package :coleslaw) (defpackage :coleslaw-analytics
(:use :cl)
(:export #:enable))
(in-package :coleslaw-analytics)
(defvar *analytics-js*
"<script type=\"text/javascript\">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '~a']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>")
(defun enable (&key tracking-code)
(add-injection (format nil *analytics-js* tracking-code) :head))