mirror of https://github.com/luizdepra/hugo-coder.git

Ellison
07.53.2020 3723e9b2b9baf9f700f5165ffd9a6ba25b25007a
Add goatcounter analytics support (#430)

* adding goatcounter analytics support

* Update CONTRIBUTORS.md
1 files added
3 files modified
14 ■■■■ changed files
CONTRIBUTORS.md 3 ●●●● patch | view | raw | blame | history
exampleSite/config.toml 6 ●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 3 ●●●●● patch | view | raw | blame | history
layouts/partials/analytics/goatcounter.html 2 ●●●●● patch | view | raw | blame | history
CONTRIBUTORS.md
@@ -79,4 +79,5 @@
- [Dave Rolsky](https://github.com/autarch)
- [Joseph Sanders](https://github.com/jls83)
- [Rabin Adhikari](https://github.com/rabinadk1/)
- [Hussaini Zulkifli](https://github.com/hussaini/)
- [Hussaini Zulkifli](https://github.com/hussaini/)
- [Ellison Leão](https://github.com/ellisonleao)
exampleSite/config.toml
@@ -62,13 +62,17 @@
    siteID = "ABCDE"
    # Default value is cdn.usefathom.com, overwrite this if you are self-hosting
    serverURL = "analytics.example.com"
# If you want to use plausible(https://plausible.io) for analytics, add this section
[params.plausibleAnalytics]
    domain = "example.com"
    # Default value is plausible.io, overwrite this if you are self-hosting or using a custom domain
    serverURL = "analytics.example.com"
# If you want to use goatcounter(https://goatcounter.com) for analytics, add this section
[params.goatCounter]
    code = "code"
[taxonomies]
  category = "categories"
  series = "series"
layouts/_default/baseof.html
@@ -131,6 +131,9 @@
      {{- partial "analytics/plausible" . -}}
    {{ end }}
    {{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
      {{- partial "analytics/goatcounter" . -}}
    {{ end }}
  </body>
</html>
layouts/partials/analytics/goatcounter.html
New file
@@ -0,0 +1,2 @@
<script data-goatcounter="https://{{ $.Site.Params.goatCounter.code }}.goatcounter.com/count"
        async src="//gc.zgo.at/count.js"></script>