Ver código fonte

Add clicky analytics (#856)

### Prerequisites

Put an `x` into the box(es) that apply:

- [ ] This pull request fixes a bug.
- [x] This pull request adds a feature.
- [ ] This pull request introduces breaking change.

### Description

Add script tag with `async` and `data-id` attributes for clicky
analytics. See https://clicky.com

The hugo-coder lacks of clicky analytics integration, which I'm
currently using.

### Checklist

Put an `x` into the box(es) that apply:

#### General

- [x] Describe what changes are being made
- [x] Explain why and how the changes were necessary and implemented
respectively
- [ ] Reference issue with `#<ISSUE_NO>` if applicable

#### Resources

- [ ] If you have changed any SCSS code, run `make release` to
regenerate all CSS files

#### Contributors

- [x] Add yourself to `CONTRIBUTORS.md` if you aren't on it already
Kirill 2 anos atrás
pai
commit
c4665043f9

+ 1 - 0
CONTRIBUTORS.md

@@ -134,3 +134,4 @@
 - [Todor Bogosavljević](https://github.com/tbx1b)
 - [Kemal Akkoyun](https://github.com/kakkoyun)
 - [Igetin](https://github.com/Igetin)
+- [Kirill Che.](https://github.com/g4s8)

+ 2 - 1
docs/analytics.md

@@ -6,6 +6,7 @@
 
 * [Application Insights](https://azure.com/) - [documentation](/docs/analytics/applicationinsights.md)
 * [Baidu Analytics](https://tongji.baidu.com/) - [documentation](/docs/analytics/baidu.md)
+* [Clicky](https://clicky.com/) - [documentation](/docs/analytics/clicky.md)
 * [Cloudflare](https://www.cloudflare.com/analytics/) - [documentation](/docs/analytics/cloudflare.md)
 * [Google Analytics](https://developers.google.com/analytics) - [documentation](/docs/analytics/googleanalytics.md)
 * [Google Tag Manager](https://developers.google.com/tag-manager) - [documentation](/docs/analytics/googletagmanager.md)
@@ -16,4 +17,4 @@
 * [Pirsch](https://pirsch.io/) - [documentation](/docs/analytics/pirsch.md)
 * [Plausible Analytics](https://plausible.io/) - [documentation](/docs/analytics/plausible.md)
 * [Umami](https://umami.is/) - [documentation](/docs/analytics/umami.md)
-* [Wide Angle Analytics](https://wideangle.co/) - [documentation](/docs/analytics/wideangle.md)
+* [Wide Angle Analytics](https://wideangle.co/) - [documentation](/docs/analytics/wideangle.md)

+ 6 - 0
docs/analytics/clicky.md

@@ -0,0 +1,6 @@
+# Clicky
+
+```toml
+[params.clicky]
+    id = "site-id"
+```

+ 4 - 0
layouts/_default/baseof.html

@@ -116,6 +116,10 @@
   {{- partial "analytics/pirsch" . -}}
   {{ end }}
 
+  {{ if and .Site.Params.clicky .Site.Params.clicky.id }}
+  {{- partial "analytics/clicky" . -}}
+  {{ end }}
+
   {{- partial "body/extensions" . -}}
 </body>
 

+ 1 - 0
layouts/partials/analytics/clicky.html

@@ -0,0 +1 @@
+<script async data-id="{{ $.Site.Params.clicky.id }}" src="//static.getclicky.com/js"></script>