Skip to content

Commit

Permalink
feat: support privacy analytics (fathom, plausible, pirsch)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcushen committed Nov 25, 2023
1 parent 97d9934 commit 804c70f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
5 changes: 5 additions & 0 deletions modules/blox-tailwind/layouts/partials/marketing/fathom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ $fathom := site.Params.marketing.analytics.fathom | default "" }}

{{ if hugo.IsProduction | and $fathom }}
<script src="https://cdn.usefathom.com/script.js" data-site="{{$fathom}}" defer></script>
{{ end }}
25 changes: 25 additions & 0 deletions modules/blox-tailwind/layouts/partials/marketing/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{/* HUGO BLOX: MARKETING MODULE */}}

{{/* VERIFICATIONS */}}

{{ with site.Params.marketing.verification.google }}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}

{{ with site.Params.marketing.verification.baidu }}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}

{{ with site.Params.marketing.verification.bing }}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}

{{/* ANALYTICS */}}

{{ partial "marketing/google_analytics" . }}
{{ partial "marketing/google_tag_manager" . }}
{{ partial "marketing/microsoft_clarity" . }}
{{ partial "marketing/baidu_tongji" . }}
{{ partial "marketing/plausible" . }}
{{ partial "marketing/fathom" . }}
{{ partial "marketing/pirsch" . }}
5 changes: 5 additions & 0 deletions modules/blox-tailwind/layouts/partials/marketing/pirsch.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ $pirsch := site.Params.marketing.analytics.pirsch | default "" }}

{{ if hugo.IsProduction | and $pirsch }}
<script defer src="https://api.pirsch.io/pirsch.js" id="pirschjs" data-code="{{$pirsch}}"></script>
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ $plausible := site.Params.marketing.analytics.plausible | default "" }}

{{ if hugo.IsProduction | and $plausible }}
<script defer data-domain="{{$plausible}}" src="https://plausible.io/js/script.js"></script>
{{ end }}
14 changes: 1 addition & 13 deletions modules/blox-tailwind/layouts/partials/site_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,7 @@
{{ end }}

{{/* Marketing */}}
{{ with site.Params.marketing.verification.google }}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{ with site.Params.marketing.verification.baidu }}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}
{{ with site.Params.marketing.verification.bing }}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}
{{ partial "marketing/google_analytics" . }}
{{ partial "marketing/google_tag_manager" . }}
{{ partial "marketing/microsoft_clarity" . }}
{{ partial "marketing/baidu_tongji" . }}
{{ partial "marketing/index" . }}

{{/* RSS Feed */}}
{{ with .OutputFormats.Get "RSS" }}
Expand Down

0 comments on commit 804c70f

Please sign in to comment.