Skip to content

Commit 9cdea9e

Browse files
committed
Adding in comments and analytics
1 parent f7a12ce commit 9cdea9e

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ paginate: 5
1010
permalink: /:year/:month/:title/
1111
markdown: kramdown
1212
theme: minima
13+
analytics:
14+
id: "UA-93047488-1"
1315
gems:
1416
- jekyll-feed
1517
- jekyll-paginate

_includes/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<head>
22
<link href="http://gmpg.org/xfn/11" rel="profile">
3+
<link rel="canonical" href="{{ site.url }}{{ page.url | replace:'index.html',''}}">
34
<meta http-equiv="X-UA-Compatible" content="IE=edge">
45
<meta http-equiv="content-type" content="text/html; charset=utf-8">
56

_layouts/default.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,14 @@ <h3 class="masthead-title">
4444
}, false);
4545
})(document);
4646
</script>
47+
<script>
48+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
49+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
50+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
51+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
52+
53+
ga('create', '{{ site.analytics.id }}', 'auto');
54+
ga('send', 'pageview');
55+
</script>
4756
</body>
4857
</html>

_layouts/post.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,19 @@ <h3>
2525
</ul>
2626
</div>
2727
{% endif %}
28+
29+
<div id="disqus_thread"></div>
30+
<script>
31+
var disqus_developer = 1;
32+
var disqus_config = function () {
33+
this.page.url = '{{ site.url }}{{ page.url | replace:"index.html","" }}';
34+
this.page.identifier = '{{ page.id }}';
35+
};
36+
(function() {
37+
var d = document, s = d.createElement('script');
38+
s.src = 'https://refactoringbyexample.disqus.com/embed.js';
39+
s.setAttribute('data-timestamp', + new Date());
40+
(d.head || d.body).appendChild(s);
41+
})();
42+
</script>
43+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

0 commit comments

Comments
 (0)