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" languageCode = "en-us"
title = "Hugo Cactus Theme" title = "Hugo Cactus Theme"
theme = "hugo-cactus-theme" theme = "hugo-cactus-theme"
# Enter your tracking code to enable Google Analytics
googleAnalytics = ""
[params] [params]
name = "Mr. Hugo" name = "Mr. Hugo"
@ -12,8 +14,6 @@ theme = "hugo-cactus-theme"
twitter = "Your Twitter account" twitter = "Your Twitter account"
# Disable comments by leaving disqusShortname empty # Disable comments by leaving disqusShortname empty
disqusShortname = "spf13" disqusShortname = "spf13"
# Enter your tracking code to enable Google Analytics
googleAnalytics = ""
enableRSS = true enableRSS = true
# The variables below are optionally too and can be used to # 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/main.js"></script>
<script src="{{ .Site.BaseURL }}js/highlight.js"></script> <script src="{{ .Site.BaseURL }}js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</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