1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 02:38:27 -04:00

extract fathom snippet into separate partial template

This commit is contained in:
Jake Jarvis 2019-10-21 10:35:19 -04:00
parent f27d1c48b7
commit cc9e2b4f23
3 changed files with 15 additions and 26 deletions

View File

@ -50,18 +50,6 @@
<h1>Welp, this is awkward... &#x1F633;</h1>
<p>The file you asked for wasn't found in this neck of the woods. Please check the URL for mistakes and try again, or take your ball and <a href="{{ .Site.BaseURL }}">go home</a>.</p>
</div>
<script>
(function(f, a, t, h, o, m){
a[h]=a[h]||function(){
(a[h].q=a[h].q||[]).push(arguments)
};
o=f.createElement('script'),
m=f.getElementsByTagName('script')[0];
o.async=1; o.src=t; o.id='fathom-script';
m.parentNode.insertBefore(o,m)
})(document, window, 'https://fathom.jarv.is/tracker.js', 'fathom');
fathom('set', 'siteId', 'DYCXU');
fathom('trackPageview');
</script>
{{ if eq hugo.Environment "production" }}{{ partial "stats.html" . }}{{ end }}
</body>
</html>

View File

@ -1,16 +1,4 @@
{{ if eq hugo.Environment "production" }}<script>
(function(f, a, t, h, o, m){
a[h]=a[h]||function(){
(a[h].q=a[h].q||[]).push(arguments)
};
o=f.createElement('script'),
m=f.getElementsByTagName('script')[0];
o.async=1; o.src=t; o.id='fathom-script';
m.parentNode.insertBefore(o,m)
})(document, window, 'https://fathom.jarv.is/tracker.js', 'fathom');
fathom('set', 'siteId', 'DYCXU');
fathom('trackPageview');
</script>{{ end }}
{{ if eq hugo.Environment "production" }}{{ partial "stats.html" . }}{{ end }}
</body>
</html>

View File

@ -0,0 +1,13 @@
<script>
(function(f, a, t, h, o, m){
a[h]=a[h]||function(){
(a[h].q=a[h].q||[]).push(arguments)
};
o=f.createElement('script'),
m=f.getElementsByTagName('script')[0];
o.async=1; o.src=t; o.id='fathom-script';
m.parentNode.insertBefore(o,m)
})(document, window, 'https://fathom.jarv.is/tracker.js', 'fathom');
fathom('set', 'siteId', 'DYCXU');
fathom('trackPageview');
</script>