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

Kirill
15.52.2023 c4665043f9957b7ed9b5a07c7074bb520563a5ba
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
3 files modified
2 files added
13 ■■■■■ changed files
CONTRIBUTORS.md 1 ●●●● patch | view | raw | blame | history
docs/analytics.md 1 ●●●● patch | view | raw | blame | history
docs/analytics/clicky.md 6 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 4 ●●●● patch | view | raw | blame | history
layouts/partials/analytics/clicky.html 1 ●●●● patch | view | raw | blame | history
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)
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)
docs/analytics/clicky.md
New file
@@ -0,0 +1,6 @@
# Clicky
```toml
[params.clicky]
    id = "site-id"
```
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>
layouts/partials/analytics/clicky.html
New file
@@ -0,0 +1 @@
<script async data-id="{{ $.Site.Params.clicky.id }}" src="//static.getclicky.com/js"></script>