add content-type and access-control headers to hit function response

This commit is contained in:
2021-05-30 19:30:06 -04:00
parent 03bc26a004
commit 37807e008b
6 changed files with 22 additions and 14 deletions
+8 -6
View File
@@ -2,19 +2,21 @@
<div class="layout layout-single">
<article>
<div id="meta">
<span id="meta-date">
<div id="meta-date">
<a class="no-underline" href="{{ .Permalink }}" title="{{ .Date.Format "Mon, Jan 2 2006 3:04:05 PM MST" }}">📅 {{ .Date.Format "January 2, 2006" }}</a>
</span>
</div>
{{ with .Scratch.Get "sourceURL" }}
<span id="meta-edit">
<div id="meta-edit">
<a class="no-underline" href="{{ . | safeURL }}" title="Edit this post on GitHub" target="_blank" rel="noopener">✏️ Improve This Post</a>
</span>
</div>
{{ end }}
<span id="meta-hits" style="display:none;">
<div id="meta-hits" style="display: none;">
👀
<div id="hit-spinner" class="spinner"><div class="spin-bounce1"></div><div class="spin-bounce2"></div><div class="spin-bounce3"></div></div>
<span id="hit-counter"></span>
</span>
</div>
</div>
<h1 class="title"><a class="no-underline" href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
+6 -6
View File
@@ -1,15 +1,15 @@
{{/* only parse and append analytics script on production site */}}
{{- $includeProdScripts := eq hugo.Environment "production" -}}
{{- $twemoji := resources.Get "js/vendor/twemoji.js" | resources.ExecuteAsTemplate "js/vendor/twemoji.js" . -}}
{{- $counter := resources.Get "js/counter.js" -}}
{{- $twemoji := resources.Get "js/vendor/twemoji.js" -}}
{{- $bundle := slice $twemoji $counter -}}
{{- $bundle := slice $counter $twemoji -}}
{{- if $includeProdScripts }}
{{- $fathom := resources.Get "js/fathom.js" | resources.ExecuteAsTemplate "js/fathom.js" . }}
{{- $bundle = $bundle | append $fathom }}
{{- end }}
{{- if $includeProdScripts -}}
{{- $fathom := resources.Get "js/fathom.js" -}}
{{- $bundle = $bundle | append $fathom -}}
{{- end -}}
{{- $js := $bundle | resources.Concat "/js/app.js" -}}
<script async defer src="{{ $js.Permalink }}"></script>