diff options
author | Kishan B <kishancs46@gmail.com> | 2019-04-05 03:19:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-05 03:19:33 +0300 |
commit | 7e72b8f63000e94cb16c98832c54064ce7d16f7a (patch) | |
tree | 86a6049fc1c0891edd62edc687494b07c7002ab9 | |
parent | 7d37d04034f1df5ba2d2c286ba9c745861e9d150 (diff) | |
parent | a15934a23011b5d84f5db7fc28e929c09824d8b8 (diff) |
Merge pull request #65 from kaitlinnewson/master
Add optional matomo analytics, fix sidebar
-rw-r--r-- | exampleSite/config.toml | 9 | ||||
-rw-r--r-- | layouts/_analytics/matomo.html | 18 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 4 | ||||
-rw-r--r-- | static/css/style.blue.css | 3 | ||||
-rw-r--r-- | static/css/style.default.css | 3 | ||||
-rw-r--r-- | static/css/style.green.css | 3 | ||||
-rw-r--r-- | static/css/style.pink.css | 3 | ||||
-rw-r--r-- | static/css/style.red.css | 3 | ||||
-rw-r--r-- | static/css/style.sea.css | 3 | ||||
-rw-r--r-- | static/css/style.violet.css | 3 |
10 files changed, 31 insertions, 21 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 948c16e..8bce9f3 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -31,6 +31,15 @@ googleAnalytics = "" # - you're done. Happy mailing! email = "you@yoursite.com" + # Optional Matomo analytics (formerly piwik) + # [params.analytics.matomo] + # URL = "https://stats.example.com" + # ID = "42" + # # Track all subdomains with "*.example.com" (Optional) + # domain = "www.example.com" + # # Optional integrity check hash + # hash = "" + # Nav links in the side bar [[params.navlinks]] name = "Home" diff --git a/layouts/_analytics/matomo.html b/layouts/_analytics/matomo.html new file mode 100644 index 0000000..cea11a6 --- /dev/null +++ b/layouts/_analytics/matomo.html @@ -0,0 +1,18 @@ +<!-- Matomo --> +<script type="text/javascript" > + var _paq = _paq || []; + _paq.push(["setDocumentTitle", document.domain + "/" + document.title]); + _paq.push(["setCookieDomain", "{{ .Site.Params.analytics.matomo.domain }}"]); + _paq.push(["setDomains", ["{{ .Site.Params.analytics.matomo.domain }}"]]); + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="{{ .Site.Params.analytics.matomo.URL }}/"; + _paq.push(['setTrackerUrl', u+'piwik.php']); + _paq.push(['setSiteId', {{ .Site.Params.analytics.matomo.ID }}]); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; {{ if .Site.Params.analytics.matomo.hash }} g.integrity="{{ .Site.Params.analytics.matomo.hash }}"; g.crossorigin="anonymous";{{ end }} s.parentNode.insertBefore(g,s); + })(); + </script> + <noscript><p><img src="{{ .Site.BaseURL }}piwik.php?idsite={{ .Site.Params.analytics.matomo.ID }}" style="border:0;" alt="" /></p></noscript> + <!-- End Matomo Code -->
\ No newline at end of file diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 0ad2811..258b5bd 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -7,3 +7,7 @@ <script src="{{ "js/imagesloaded.pkgd.min.js" | absURL }}"></script> <script src="{{ "js/owl.carousel.min.js" | absURL }}"></script> <script src="{{ "js/front.js" | absURL }}"></script> + +{{ if .Site.Params.analytics.matomo }} + {{ partial "_analytics/matomo.html" . }} +{{ end }} diff --git a/static/css/style.blue.css b/static/css/style.blue.css index 719eafc..8088ec5 100644 --- a/static/css/style.blue.css +++ b/static/css/style.blue.css @@ -319,10 +319,7 @@ SIDEBAR + RIGHT COLUMN #sidebar { padding-top: 40px; } -/*modified sidebar to follow scroll */ .sidebar-content { - position: fixed; - width: inherit; z-index: 0; padding: 0 1.7em 0 0em; } diff --git a/static/css/style.default.css b/static/css/style.default.css index 89773fb..9687bd5 100644 --- a/static/css/style.default.css +++ b/static/css/style.default.css @@ -319,10 +319,7 @@ SIDEBAR + RIGHT COLUMN #sidebar { padding-top: 40px; } -/*modified sidebar to follow scroll */ .sidebar-content { - position: fixed; - width: inherit; z-index: 0; padding: 0 1.7em 0 0em; } diff --git a/static/css/style.green.css b/static/css/style.green.css index e770ce0..b7a2457 100644 --- a/static/css/style.green.css +++ b/static/css/style.green.css @@ -319,10 +319,7 @@ SIDEBAR + RIGHT COLUMN #sidebar { padding-top: 40px; } -/*modified sidebar to follow scroll */ .sidebar-content { - position: fixed; - width: inherit; z-index: 0; padding: 0 1.7em 0 0em; } diff --git a/static/css/style.pink.css b/static/css/style.pink.css index a4e3b85..910567a 100644 --- a/static/css/style.pink.css +++ b/static/css/style.pink.css @@ -319,10 +319,7 @@ SIDEBAR + RIGHT COLUMN #sidebar { padding-top: 40px; } -/*modified sidebar to follow scroll */ .sidebar-content { - position: fixed; - width: inherit; z-index: 0; padding: 0 1.7em 0 0em; } diff --git a/static/css/style.red.css b/static/css/style.red.css index 6718899..176357b 100644 --- a/static/css/style.red.css +++ b/static/css/style.red.css @@ -319,10 +319,7 @@ SIDEBAR + RIGHT COLUMN #sidebar { padding-top: 40px; } -/*modified sidebar to follow scroll */ .sidebar-content { - position: fixed; - width: inherit; z-index: 0; padding: 0 1.7em 0 0em; } diff --git a/static/css/style.sea.css b/static/css/style.sea.css index 389d92d..37e27e6 100644 --- a/static/css/style.sea.css +++ b/static/css/style.sea.css @@ -319,10 +319,7 @@ SIDEBAR + RIGHT COLUMN #sidebar { padding-top: 40px; } -/*modified sidebar to follow scroll */ .sidebar-content { - position: fixed; - width: inherit; z-index: 0; padding: 0 1.7em 0 0em; } diff --git a/static/css/style.violet.css b/static/css/style.violet.css index e3fa656..91c1426 100644 --- a/static/css/style.violet.css +++ b/static/css/style.violet.css @@ -319,10 +319,7 @@ SIDEBAR + RIGHT COLUMN #sidebar { padding-top: 40px; } -/*modified sidebar to follow scroll */ .sidebar-content { - position: fixed; - width: inherit; z-index: 0; padding: 0 1.7em 0 0em; } |