From 4047401c3743373f20de8a045c6c9c1fb324f7bc Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Fri, 16 Jun 2017 16:58:08 +0200 Subject: [PATCH] Added piwik integration. --- README.md | 3 +++ layouts/_default/baseof.html | 1 + layouts/partials/piwik.html | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 layouts/partials/piwik.html diff --git a/README.md b/README.md index 2e95188..736f960 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ This is a port of that theme for [Hugo :: A fast and modern static website engin * jQuery 2 * Slicknav mobile menu * Search with DuckDuckGo +* Analytics with Piwik ## On the large screen @@ -61,6 +62,8 @@ params: icon: "" # Relative path to icon in json feed, no leading slash. jquery: true # Add jQuery logo: false # Turn off the logo. + piwikSiteId: # Piwik site id + piwikTrackerUrl: "" # Piwik url, schemaless and no slash on end (example.com/piwik). poweredby: true # Show powered by hugo in footer search: true # Site search with DuckDuckGo. searchSize: 20 # Search field size, default 20. diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d36a352..e41b2a8 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -6,6 +6,7 @@ {{ block "meta" . }}{{ end }} {{- partialCached "meta.html" . -}} +{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID }}{{ partialCached "piwik.html" . }}{{ end -}} diff --git a/layouts/partials/piwik.html b/layouts/partials/piwik.html new file mode 100644 index 0000000..97d6f27 --- /dev/null +++ b/layouts/partials/piwik.html @@ -0,0 +1,12 @@ +