Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Commit

Permalink
Replace Google Analytics with internal tmpl
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalcraftsman committed Nov 26, 2015
1 parent 75ae4b5 commit c2cdd9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ baseurl = "http://replace-this-with-your-domain.com/"
languageCode = "en-us"
title = "Hugo Cactus Theme"
theme = "hugo-cactus-theme"
# Enter your tracking code to enable Google Analytics
googleAnalytics = ""

[params]
name = "Mr. Hugo"
Expand All @@ -12,8 +14,6 @@ theme = "hugo-cactus-theme"
twitter = "Your Twitter account"
# Disable comments by leaving disqusShortname empty
disqusShortname = "spf13"
# Enter your tracking code to enable Google Analytics
googleAnalytics = ""
enableRSS = true

# The variables below are optionally too and can be used to
Expand Down
11 changes: 1 addition & 10 deletions layouts/partials/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@
<script src="{{ .Site.BaseURL }}js/main.js"></script>
<script src="{{ .Site.BaseURL }}js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

{{ with .Site.Params.googleAnalytics }}
{{ "<!-- Google Analytics -->" | safeHTML }}
<script>
var _gaq=[['_setAccount','{{ . }}'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
{{ end }}
{{ template "_internal/google_analytics.html" . }}

0 comments on commit c2cdd9a

Please sign in to comment.