Add Analytics plugin, extend example coleslawrc.
This commit is contained in:
parent
7024377cad
commit
f2fa130527
3 changed files with 27 additions and 2 deletions
|
@ -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.
|
||||
* Plugins for...
|
||||
* Comments via Disqus
|
||||
* Analytics via Google
|
||||
* Using LaTeX (inside pairs of $$) via Mathjax
|
||||
* Importing posts from wordpress
|
||||
* There is also a [Heroku buildpack](https://github.com/jsmpereira/coleslaw-heroku) maintained by Jose Pereira.
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
:deploy "/home/git/blog/"
|
||||
:domain "http://blog.redlinernotes.com"
|
||||
:feeds ("lisp")
|
||||
:plugins (mathjax)
|
||||
:plugins (mathjax
|
||||
(disqus :shortname "my-site-name")
|
||||
(analytics :tracking-code "foo"))
|
||||
:repo "/home/git/tmp/improvedmeans/"
|
||||
:sitenav ((:url "http://redlinernotes.com/" :name "Home")
|
||||
(:url "http://twitter.com/redline6561" :name "Twitter")
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue