Explorar o código

Add self-hosted goat counter (#826)

* Add self-hosted goat counter

* GoatCounter custom instance and beckward compatibility

---------

Co-authored-by: SilverLuke <luca99.argentieri@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Luca Argentieri hai 1 ano
pai
achega
05c9d3d850
Modificáronse 1 ficheiros con 7 adicións e 7 borrados
  1. 7 7
      layouts/partials/analytics.html

+ 7 - 7
layouts/partials/analytics.html

@@ -1,6 +1,6 @@
 <!-- Add Analytics if enabled in configuration -->
 {{ with site.Params.features.analytics }}
-    {{ if .enabled }}
+    {{ if or .enable .enabled }}
         {{ with .services }}
         <!-- Google Analytics -->
         {{ with .google }}
@@ -18,12 +18,12 @@
         {{ end }}
 
         <!-- GoatCounter -->
-        {{ with .goatCounter }}
-            <script
-            data-goatcounter="https://{{ .code }}.goatcounter.com/count"
-            async
-            src="//gc.zgo.at/count.js"
-            ></script>
+	{{ with .goatCounter }}
+		{{ with .code }}
+			<script data-goatcounter="https://{{ . }}.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
+    		{{ else }}
+     			<script data-goatcounter="https://{{ .instance }}/count" async src="https://{{ .instance }}/count.js"></script>
+		{{ end }}
         {{ end }}
 
         <!-- Piwik/Matomo -->