mirror of https://github.com/lxndrblz/anatole.git

Alexander Bilz
03.53.2021 dca52556c0143a1f703cadb399e60a3c7e8395f0
Added SimpleAnalytics
1 files added
3 files modified
25 ■■■■■ changed files
README.md 11 ●●●●● patch | view | raw | blame | history
exampleSite/config.toml 4 ●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 3 ●●●●● patch | view | raw | blame | history
layouts/partials/analytics/simpleanalytics.html 7 ●●●●● patch | view | raw | blame | history
README.md
@@ -18,6 +18,7 @@
- Multilingual
- 100⁄100 Google Lighthouse score
- Google Analytics (optional)
- SimpleAnalytics (optional)
- Comments powered by Disqus (optional)
- Katex support (optional)
- Formspree Contact Form (optional)
@@ -209,6 +210,16 @@
googleAnalytics = "UA-123-45"
```
### Simple Analytics
To use Simple Analytics, it has to be enabled by setting the parameter to true. If you are using a custom subdomain to evade Adblockers, then specify the URL without a trailing slash.
```toml
[params.simpleAnalytics]
enable = true
# customurl = "https://analytics.example.com"
```
### Google Site Verification
To use Google Site Verification, add the following line to the `[params]`:
exampleSite/config.toml
@@ -38,6 +38,10 @@
# Google Site Verify
#googleSiteVerify = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
[params.simpleAnalytics]
# enable = true
# customurl = "https://analytics.example.com"
## Math settings
[params.math]
enable = false  # options: true, false. Enable math support globally, default: false. You can always enable math on per page.
layouts/_default/baseof.html
@@ -14,6 +14,9 @@
</div>
{{- partial "footer.html" . -}}
{{- if (eq .Site.Params.simpleAnalytics.enable true) -}}
    {{- partial "analytics/simpleanalytics.html" . -}}
{{- end -}}
</body>
</html>
layouts/partials/analytics/simpleanalytics.html
New file
@@ -0,0 +1,7 @@
{{ with .Site.Params.simpleAnalytics.customUrl }}
<script async defer src="{{ . | relURL }}/latest.js"></script>
<noscript><img src="{{ . | relURL }}/noscript.gif" alt=""/></noscript>
{{ else }}
<script async defer src=" https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt=""/></noscript>
{{ end }}