1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-18 22:15:32 -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

@@ -47,8 +47,6 @@
}
}
</style>
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32 48") }}
</head>
<body>
<div id="message">

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 }}

View File

@@ -15,7 +15,7 @@
<p class="image">
{{ with .Get "link" }}<a class="no-underline" href="{{ . }}"{{ if strings.HasPrefix . "http" }} target="_blank" rel="noopener"{{ end }}>{{ end }}
<img src="{{ $optimized.Permalink }}" width="{{ $optimized.Width }}" height="{{ $optimized.Height }}"
{{- with .Get "alt" }} alt="{{ . | safeHTML }}" title="{{ . | safeHTML }}"{{ end }}>
{{- with .Get "alt" }} alt="{{ . | safeHTML }}" title="{{ . | safeHTML }}"{{ end }}>
{{ if .Get "link" }}</a>{{ end }}
</p>
{{- end }}