1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-12-03 03:48:55 -05:00

bundle fathom analytics script into first-party app.js

This commit is contained in:
2021-01-31 12:23:50 -05:00
parent 28b7e8ffd1
commit ef445a538b
11 changed files with 378 additions and 247 deletions

View File

@@ -6,8 +6,7 @@
</footer>
{{ if eq hugo.Environment "production" }}
<!-- https://docs.simpleanalytics.com/without-javascript -->
<amp-pixel src="{{ "api/send_view" | absURL }}?noscript=true&amp;type=pageview&amp;hostname=CANONICAL_HOSTNAME&amp;path=CANONICAL_PATH&amp;referrer=DOCUMENT_REFERRER&amp;https=true&amp;ua=USER_AGENT&amp;width=VIEWPORT_WIDTH" layout="nodisplay"></amp-pixel>
<amp-pixel src="{{ "api/count_view" | absURL }}?p=CANONICAL_PATH&amp;h=SOURCE_URL&amp;r=DOCUMENT_REFERRER&amp;sid=PPSQZUDY" layout="nodisplay"></amp-pixel>
{{ end }}
</body>
</html>

View File

@@ -7,8 +7,8 @@
{{- $bundle := slice $darkmode $twemoji -}}
{{- if $includeProdScripts }}
{{- $analytics := resources.Get "js/analytics.js" | resources.ExecuteAsTemplate "js/analytics.js" . }}
{{- $bundle = slice $darkmode $twemoji $analytics }}
{{- $fathom := resources.Get "js/fathom.js" | resources.ExecuteAsTemplate "js/fathom.js" . }}
{{- $bundle = slice $darkmode $twemoji $fathom }}
{{- end }}
{{- $js := $bundle | resources.Concat "/js/app.js" -}}
@@ -20,7 +20,3 @@
{{- $searchJS := slice $algolia $algoliaConfig | resources.Concat "/js/search.js" -}}
<script async defer src="{{ $searchJS.Permalink }}"></script>
{{ end }}
{{- if $includeProdScripts }}
<script async defer src="https://manatee.jarv.is/script.js" data-site="PPSQZUDY"></script>
{{ end }}

View File

@@ -1 +0,0 @@
<script src="https://manatee.jarv.is/script.js" data-site="PPSQZUDY" defer></script>