diff options
author | Juraj Bubniak <juraj.bubniak@exponea.com> | 2020-01-07 13:12:49 +0300 |
---|---|---|
committer | Juraj Bubniak <juraj.bubniak@exponea.com> | 2020-01-07 13:12:49 +0300 |
commit | 7a1356ceab60cd2209283baf54b2ae32c6b70a5e (patch) | |
tree | ba69521350095bfece6bc993c1805bd4fed9e381 | |
parent | 409f0d53dea71670fa2f3637a075d82c1a97f5b6 (diff) |
Add support for fathom analytics.
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/partials/fathom.html | 17 | ||||
-rw-r--r-- | layouts/partials/header.html | 1 |
4 files changed, 22 insertions, 0 deletions
@@ -90,6 +90,8 @@ disqusShortname = "XXX" exponeaTrackVisits = false readingTime = true readingTimeText = "Estimated reading time:" + fathomUrl = "" + fathomSiteId = "" [Permalinks] post = "/:year/:month/:day/:filename/" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a36de5a..cad3a32 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -50,6 +50,8 @@ googleAnalytics = "XXX" exponeaTrackVisits = false readingTime = true readingTimeText = "Estimated reading time:" + fathomUrl = "" + fathomSiteId = "" [Permalinks] post = "/:year/:month/:day/:filename/" diff --git a/layouts/partials/fathom.html b/layouts/partials/fathom.html new file mode 100644 index 0000000..896cfba --- /dev/null +++ b/layouts/partials/fathom.html @@ -0,0 +1,17 @@ +{{ if .Site.Params.fathomUrl }} + <!-- Fathom - simple website analytics - https://github.com/usefathom/fathom --> + <script> + (function(f, a, t, h, o, m){ + a[h]=a[h]||function(){ + (a[h].q=a[h].q||[]).push(arguments) + }; + o=f.createElement('script'), + m=f.getElementsByTagName('script')[0]; + o.async=1; o.src=t; o.id='fathom-script'; + m.parentNode.insertBefore(o,m) + })(document, window, '{{ .Site.Params.fathomUrl }}', 'fathom'); + fathom('set', 'siteId', '{{ .Site.Params.fathomSiteId }}'); + fathom('trackPageview'); + </script> + <!-- / Fathom --> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 12edfad..3ba43f0 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -19,6 +19,7 @@ {{ end }} {{ partial "extra-in-head.html" . }} {{ partial "exponea.html" . }} + {{ partial "fathom.html" . }} </head> <body> {{ template "_internal/google_analytics.html" . }} |