mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-07-27 12:56:03 -04:00
super simple serverless hit counter for fun (#410)
This commit is contained in:
@@ -2,7 +2,19 @@
|
||||
<div class="layout layout-single">
|
||||
<article>
|
||||
<div id="meta">
|
||||
<a class="no-underline" href="{{ .Permalink }}" title="{{ .Date.Format "Mon, Jan 2 2006 3:04:05 PM MST" }}">{{ .Date.Format "January 2, 2006" }}</a>{{ with .Scratch.Get "sourceURL" }}<span class="dash">—</span><a class="no-underline" href="{{ . | safeURL }}" title="Edit this post on GitHub" target="_blank" rel="noopener">Improve This Post</a>{{ end }}
|
||||
<span 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>
|
||||
{{ with .Scratch.Get "sourceURL" }}
|
||||
<span id="meta-edit">
|
||||
<a class="no-underline" href="{{ . | safeURL }}" title="Edit this post on GitHub" target="_blank" rel="noopener">✏️ Improve This Post</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
<span 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>
|
||||
|
||||
<h1 class="title"><a class="no-underline" href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
{{- $includeProdScripts := eq hugo.Environment "production" -}}
|
||||
|
||||
{{- $twemoji := resources.Get "js/vendor/twemoji.js" | resources.ExecuteAsTemplate "js/vendor/twemoji.js" . -}}
|
||||
{{- $counter := resources.Get "js/counter.js" -}}
|
||||
|
||||
{{- $bundle := slice $twemoji -}}
|
||||
{{- $bundle := slice $twemoji $counter -}}
|
||||
|
||||
{{- if $includeProdScripts }}
|
||||
{{- $fathom := resources.Get "js/fathom.js" | resources.ExecuteAsTemplate "js/fathom.js" . }}
|
||||
|
||||
Reference in New Issue
Block a user