Skip to content

Commit

Permalink
Use Hugo's Google Analytics template
Browse files Browse the repository at this point in the history
  • Loading branch information
dguo committed May 17, 2018
1 parent 3f02ffc commit c8948f8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

{{ .Content }}

{{ partial "footer.html" }}
{{ partial "footer.html" . }}
</div>

{{ partial "default-js.html" }}
{{ partial "default-js.html" . }}
</body>
</html>
4 changes: 2 additions & 2 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</p>
{{ end }}

{{ partial "footer.html" }}
{{ partial "footer.html" . }}
</div>

{{ partial "default-js.html" }}
{{ partial "default-js.html" . }}
</body>
</html>
4 changes: 2 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

{{ .Content }}

{{ partial "footer.html" }}
{{ partial "footer.html" . }}
</div>

{{ partial "default-js.html" }}
{{ partial "default-js.html" . }}
</body>
</html>
10 changes: 2 additions & 8 deletions layouts/partials/default-js.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
greetings[Math.floor(Math.random() * greetings.length)];

anchors.add();

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-90320718-1', 'auto');
ga('send', 'pageview');
</script>

{{ template "_internal/google_analytics_async.html" . }}

0 comments on commit c8948f8

Please sign in to comment.