mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Add support for plausible analytics (#382)
* Add myself to contributors.md * Add plausible config to example * Add plausible to base layout * Add plausible analytics snippet * Remove unneeded part of snippet * Add plausible config to stackbit
This commit is contained in:
@@ -71,3 +71,4 @@
|
|||||||
- [Endormi](https://endormi.io)
|
- [Endormi](https://endormi.io)
|
||||||
- [Rajiv Ranjan Singh](https://iamrajiv.github.io/)
|
- [Rajiv Ranjan Singh](https://iamrajiv.github.io/)
|
||||||
- [Pakhomov Alexander](https://github.com/PakhomovAlexander)
|
- [Pakhomov Alexander](https://github.com/PakhomovAlexander)
|
||||||
|
- [Rhys Perry](https://rhysperry.com)
|
||||||
|
|||||||
@@ -60,6 +60,12 @@ disqusShortname = "yourdiscussshortname"
|
|||||||
siteID = "ABCDE"
|
siteID = "ABCDE"
|
||||||
# Default value is cdn.usefathom.com, overwrite this if you are self-hosting
|
# Default value is cdn.usefathom.com, overwrite this if you are self-hosting
|
||||||
serverURL = "analytics.example.com"
|
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"
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
category = "categories"
|
category = "categories"
|
||||||
|
|||||||
@@ -127,6 +127,10 @@
|
|||||||
{{- partial "analytics/fathom" . -}}
|
{{- partial "analytics/fathom" . -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
|
||||||
|
{{- partial "analytics/plausible" . -}}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
1
layouts/partials/analytics/plausible.html
Normal file
1
layouts/partials/analytics/plausible.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<script async defer data-domain=”{{ .Site.Params.plausibleAnalytics.domain }}” src=”https://{{ .Site.Params.plausibleAnalytics.serverURL | default "plausible.io" }}/js/index.js”></script>
|
||||||
@@ -114,6 +114,16 @@ models:
|
|||||||
- type: string
|
- type: string
|
||||||
name: serverURL
|
name: serverURL
|
||||||
label: URL for Fathom Analytics
|
label: URL for Fathom Analytics
|
||||||
|
- type: object
|
||||||
|
name: plausibleAnalytics
|
||||||
|
label: Plausible Analytics (optional)
|
||||||
|
fields:
|
||||||
|
- type: string
|
||||||
|
name: domain
|
||||||
|
label: Website domain for Plausible Analytics
|
||||||
|
- type: string
|
||||||
|
name: serverURL
|
||||||
|
label: URL for Plausible Analytics
|
||||||
- type: object
|
- type: object
|
||||||
name: languages
|
name: languages
|
||||||
fields:
|
fields:
|
||||||
|
|||||||
Reference in New Issue
Block a user