mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 23:35:31 -04:00
clean up a bunch of layouts, especially social-images function
also made even more config.toml parameters optional, will help when finally releasing theme
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
{{ $darkmode := resources.Get "js/dark-mode.js" | resources.ExecuteAsTemplate "js/dark-mode.js" . }}
|
||||
{{ $twemoji := resources.Get "vendor/emoji/emoji.js" | resources.ExecuteAsTemplate "vendor/emoji/emoji.min.js" . }}
|
||||
{{- $darkmode := resources.Get "js/dark-mode.js" | resources.ExecuteAsTemplate "js/dark-mode.js" . -}}
|
||||
{{- $twemoji := resources.Get "js/vendor/twemoji.js" | resources.ExecuteAsTemplate "js/vendor/twemoji.js" . -}}
|
||||
|
||||
{{ $bundle := slice $darkmode $twemoji }}
|
||||
{{- $bundle := slice $darkmode $twemoji -}}
|
||||
|
||||
{{/* only parse and append analytics script on production site */}}
|
||||
{{ $includeAnalytics := eq hugo.Environment "production" }}
|
||||
{{- $includeAnalytics := eq hugo.Environment "production" -}}
|
||||
|
||||
{{ if $includeAnalytics }}
|
||||
{{ $analytics := resources.Get "js/simple-analytics.js" | resources.ExecuteAsTemplate "js/simple-analytics.js" . }}
|
||||
{{ $bundle = slice $darkmode $twemoji $analytics }}
|
||||
{{ end }}
|
||||
{{- if $includeAnalytics }}
|
||||
{{- $analytics := resources.Get "js/analytics.js" | resources.ExecuteAsTemplate "js/analytics.js" . }}
|
||||
{{- $bundle = slice $darkmode $twemoji $analytics }}
|
||||
{{- end }}
|
||||
|
||||
{{ $js := $bundle | resources.Concat "/js/app.js" }}
|
||||
{{- $js := $bundle | resources.Concat "/js/app.js" -}}
|
||||
<script async defer src="{{ $js.Permalink }}"></script>
|
||||
|
||||
{{/* proxy to simple analytics noscript on production */}}
|
||||
{{ if $includeAnalytics }}
|
||||
{{- if $includeAnalytics }}
|
||||
<noscript><img src="{{ "sa/manual.gif" | absURL }}" alt=""></noscript>
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
|
Reference in New Issue
Block a user