Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Commit

Permalink
Switch to Hugo's internal Google Analytics template
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalcraftsman committed Aug 4, 2016
1 parent 71410ed commit 5bdca7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 2 additions & 3 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ languageCode = "en-us"
title = "Strata"
theme = "hugo-strata-theme"
disqusShortname = "spf13"
# Enable Google Analytics by inserting your tracking code
googleAnalytics = ""
# Define how many posts should appear on a site
paginate = 10

Expand All @@ -12,9 +14,6 @@ paginate = 10
name = "Your name"
description = "Describe your website"

# Enable Google Analytics by inserting your tracking code
googleAnalytics = ""

# Format dates with Go's time formatting
date_format = "2006-01-02"

Expand Down
10 changes: 1 addition & 9 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,4 @@
<!--[if lte IE 8]><script src="{{ .Site.BaseURL }}js/ie/respond.min.js"></script><![endif]-->
<script src="{{ .Site.BaseURL }}js/main.js"></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_async.html" . }}

0 comments on commit 5bdca7d

Please sign in to comment.