Skip to content

Commit 0ac7f8f

Browse files
author
Tom Clark
committed
Add google analytics for reals
1 parent be512d9 commit 0ac7f8f

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

_config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
pygments: true
22
markdown: kramdown
3-
4-
google_analytics_tracking_id: UA-30727234-1

_layouts/default.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@
1919
<!--[if lt IE 9]>
2020
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
2121
<![endif]-->
22+
<script type="text/javascript">
23+
var _gaq = _gaq || [];
24+
_gaq.push(['_setAccount', 'UA-30727234-1']);
25+
_gaq.push(['_trackPageview']);
26+
27+
(function() {
28+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
29+
ga.src = ('https:' == document.___location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
30+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
31+
})();
32+
</script>
2233
</head>
2334
<body>
2435
<div class="wrapper">
@@ -42,5 +53,21 @@ <h1>tutorials.github.com</h1>
4253
</footer>
4354
</div>
4455
<!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
56+
<script id="sidebar_template" type="text/x-underscore" charset="utf-8">
57+
<% _(visible).each(function(values, name) { %>
58+
<h3><%= name %> (<%= visible_counts[name] %>)</h3>
59+
<ul>
60+
<% _(values).each(function(count, val) { %>
61+
<li data-name="<%= name %>", data-value="<%= val %>">
62+
<% if(_(filters).any(function(filter) { return filter.name === name && filter.value === val; })) { %>
63+
<strong><%= val %></strong>
64+
<% } else { %>
65+
<%= val %> (<%= count %>)
66+
<% } %>
67+
</li>
68+
<% }) %>
69+
</ul>
70+
<% }) %>
71+
</script>
4572
</body>
4673
</html>

0 commit comments

Comments
 (0)