🩹 Check `hugo.IsProduction` when including analytics

Ref #179
pull/185/head
James Panther 2022-04-25 11:12:02 +10:00
parent 136284e66b
commit 6e56d2daa1
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
- Updated French translation ([#178](https://github.com/jpanther/congo/pull/178))
- Analytics partial now checks `hugo.IsProduction` instead of `.Site.IsServer` before including scripts ([#179](https://github.com/jpanther/congo/issues/179))
- Upgrade to Tailwind v3.0.24 ([#176](https://github.com/jpanther/congo/pull/176))
- Upgrade to Mermaid v9.0.1 ([#183](https://github.com/jpanther/congo/pull/183))

View File

@ -1,4 +1,4 @@
{{ if not .Site.IsServer }}
{{ if hugo.IsProduction }}
{{ with .Site.Params.fathomAnalytics.site }}
{{ if isset $.Site.Params.fathomanalytics "domain" }}
<script defer src="https://{{ $.Site.Params.fathomanalytics.domain }}/script.js" data-site="{{ . }}"></script>