mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 15:45:33 -04:00
extract fathom snippet into separate partial template
This commit is contained in:
@@ -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>
|
||||
|
||||
|
13
layouts/partials/stats.html
Normal file
13
layouts/partials/stats.html
Normal 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>
|
Reference in New Issue
Block a user