Skip to content

Commit 3723e9b

Browse files
authored
Add goatcounter analytics support (luizdepra#430)
* adding goatcounter analytics support * Update CONTRIBUTORS.md
1 parent 3087f9b commit 3723e9b

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

CONTRIBUTORS.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@
7979
- [Dave Rolsky](https://github.com/autarch)
8080
- [Joseph Sanders](https://github.com/jls83)
8181
- [Rabin Adhikari](https://github.com/rabinadk1/)
82-
- [Hussaini Zulkifli](https://github.com/hussaini/)
82+
- [Hussaini Zulkifli](https://github.com/hussaini/)
83+
- [Ellison Leão](https://github.com/ellisonleao)

exampleSite/config.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,17 @@ disqusShortname = "yourdiscussshortname"
6262
siteID = "ABCDE"
6363
# Default value is cdn.usefathom.com, overwrite this if you are self-hosting
6464
serverURL = "analytics.example.com"
65-
65+
6666
# If you want to use plausible(https://plausible.io) for analytics, add this section
6767
[params.plausibleAnalytics]
6868
domain = "example.com"
6969
# Default value is plausible.io, overwrite this if you are self-hosting or using a custom domain
7070
serverURL = "analytics.example.com"
7171

72+
# If you want to use goatcounter(https://goatcounter.com) for analytics, add this section
73+
[params.goatCounter]
74+
code = "code"
75+
7276
[taxonomies]
7377
category = "categories"
7478
series = "series"

layouts/_default/baseof.html

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@
131131
{{- partial "analytics/plausible" . -}}
132132
{{ end }}
133133

134+
{{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
135+
{{- partial "analytics/goatcounter" . -}}
136+
{{ end }}
134137
</body>
135138

136139
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<script data-goatcounter="https://{{ $.Site.Params.goatCounter.code }}.goatcounter.com/count"
2+
async src="//gc.zgo.at/count.js"></script>

0 commit comments

Comments
 (0)