1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 14:46:37 -04:00

re-tool/clean up scripts and redirects

This commit is contained in:
2020-06-19 09:45:48 -04:00
parent daeb846865
commit f29033f383
8 changed files with 46 additions and 69 deletions

View File

@ -4,9 +4,9 @@
{{ $bundle := slice $darkmode $twemoji }}
{{/* only parse and append analytics script on production site */}}
{{ $useAnalytics := eq hugo.Environment "production" }}
{{ $includeAnalytics := eq hugo.Environment "production" }}
{{ if $useAnalytics }}
{{ if $includeAnalytics }}
{{ $analytics := resources.Get "js/simple-analytics.js" | resources.ExecuteAsTemplate "js/simple-analytics.js" . }}
{{ $bundle = slice $darkmode $twemoji $analytics }}
{{ end }}
@ -15,6 +15,6 @@
<script async defer src="{{ $js.Permalink }}"></script>
{{/* proxy to simple analytics noscript on production */}}
{{ if $useAnalytics }}
<noscript><img src="{{ "sa/noscript.gif" | absURL }}" alt=""></noscript>
{{ if $includeAnalytics }}
<noscript><img src="{{ "sa/manual.gif" | absURL }}" alt=""></noscript>
{{ end }}