Commented out hit counter for now
This commit is contained in:
parent
859ec57f70
commit
52a727af42
2
hugo.yml
2
hugo.yml
@ -22,6 +22,8 @@ params:
|
||||
url: "https://mnw.sdf.org"
|
||||
favicon: favicon.ico
|
||||
lazy_load_images: true
|
||||
# hit counter
|
||||
# goatcounter: "mnw"
|
||||
schema:
|
||||
blog:
|
||||
"@context": "http://schema.org"
|
||||
|
21
layouts/_default/single.html
Normal file
21
layouts/_default/single.html
Normal file
@ -0,0 +1,21 @@
|
||||
{{ define "main" -}}
|
||||
<div class="post">
|
||||
{{ partial "post/info.html" . }}
|
||||
{{ .Content }}
|
||||
{{ if (.Site.Params.listmonk) }}
|
||||
{{ partial "post/listmonk_email_newsletters.html" . }}
|
||||
{{ end }}
|
||||
{{ partial "post/navigation.html" . }}
|
||||
{{ if or (.Site.Params.remark42) (.Site.Config.Services.Disqus.Shortname) }}
|
||||
{{ partial "post/comments.html" . }}
|
||||
{{ end }}
|
||||
{{- if .Site.Params.goatcounter }}
|
||||
{{ partial "analytics.html" . -}}
|
||||
{{- end}}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ define "sidebar" }}
|
||||
{{ if and (not .Params.hideToc) (not .Site.Params.hideToc) }}
|
||||
{{ partial "table_of_contents.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
11
layouts/partials/analytics.html
Normal file
11
layouts/partials/analytics.html
Normal file
@ -0,0 +1,11 @@
|
||||
<div>There's still time for <div id="stats"></div> of you to escape. <3 </div>
|
||||
|
||||
<script>
|
||||
var r = new XMLHttpRequest();
|
||||
r.addEventListener('load', function() {
|
||||
document.querySelector('#stats').innerText = JSON.parse(this.responseText).count
|
||||
})
|
||||
r.open('GET', 'https://{{ .Site.Params.goatcounter }}.goatcounter.com/counter/' + encodeURIComponent(location.pathname) + '.json')
|
||||
r.send()
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user