From 22c8662eb47ac0d77f571eba180868c0a32c65c5 Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Wed, 9 Sep 2015 20:26:38 +0200 Subject: [PATCH] Add Google Analytics option Fixes #3 --- exampleSite/config.toml | 2 ++ layouts/partials/js.html | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index abb283a..e3622b1 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -12,6 +12,8 @@ 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 diff --git a/layouts/partials/js.html b/layouts/partials/js.html index 0c7a08f..0b0ab80 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -1,4 +1,14 @@ - \ No newline at end of file + + +{{ with .Site.Params.googleAnalytics }} +{{ "" | safeHTML }} + +{{ end }} \ No newline at end of file