Browse Source

Replace Google Analytics with internal tmpl

master
digitalcraftsman 9 years ago
parent
commit
c2cdd9a02a
  1. 4
      exampleSite/config.toml
  2. 11
      layouts/partials/js.html

4
exampleSite/config.toml

@ -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"
@ -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

11
layouts/partials/js.html

@ -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" . }}
Loading…
Cancel
Save