Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jbub/ghostwriter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Navarro <erick@navarro.io>2020-10-15 09:24:03 +0300
committerGitHub <noreply@github.com>2020-10-15 09:24:03 +0300
commitde80afadd57bb3fb4bbd15ba9ea0f8680af17b71 (patch)
tree562ee56d2795ba90c5383dbd0f2b8aa16b6d0461
parentd59e88c2311fd99545314ecbe864bb2180ee0f57 (diff)
Add plausible analytics support (#91)
Add the required script for analytics tracking using plausible
-rw-r--r--README.md4
-rw-r--r--exampleSite/config.yml5
-rw-r--r--layouts/partials/header.html1
-rw-r--r--layouts/partials/plausible.html3
4 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index 5aac41e..9579698 100644
--- a/README.md
+++ b/README.md
@@ -101,6 +101,10 @@ params:
readingTimeText: "Estimated reading time:"
fathomUrl: ""
fathomSiteId: ""
+ plausibleAnalytics:
+ domain: ""
+ # Default value is plausible.io, overwrite this if you are self-hosting or using a custom domain
+ serverURL: ""
permalinks:
post: "/:year/:month/:day/:filename/"
diff --git a/exampleSite/config.yml b/exampleSite/config.yml
index 91e9489..daaa39d 100644
--- a/exampleSite/config.yml
+++ b/exampleSite/config.yml
@@ -61,6 +61,11 @@ params:
readingTimeText: "Estimated reading time:"
fathomUrl: ""
fathomSiteId: ""
+ # If you want to use plausible(https://plausible.io) for analytics, add this section
+ plausibleAnalytics:
+ domain: ""
+ # Default value is plausible.io, overwrite this if you are self-hosting or using a custom domain
+ serverURL: ""
permalinks:
post: "/:year/:month/:day/:filename/"
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 4ebb753..1a60fb7 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -21,6 +21,7 @@
{{ partial "extra-in-head.html" . }}
{{ partial "exponea.html" . }}
{{ partial "fathom.html" . }}
+ {{ partial "plausible.html" . }}
</head>
<body>
{{ template "_internal/google_analytics.html" . }}
diff --git a/layouts/partials/plausible.html b/layouts/partials/plausible.html
new file mode 100644
index 0000000..120a2f9
--- /dev/null
+++ b/layouts/partials/plausible.html
@@ -0,0 +1,3 @@
+{{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
+ <script async defer data-domain="{{ .Site.Params.plausibleAnalytics.domain }}" src="https://{{ .Site.Params.plausibleAnalytics.serverURL | default "plausible.io" }}/js/plausible.js"></script>
+{{ end }}