From 1efec98b9aab35898d20ccd5746efda95cb29b20 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 27 Oct 2019 23:18:35 +0000 Subject: [PATCH] Swap out Fathom for Matomo --- index.ts | 8 +++++++- src/fathom.js | 12 ------------ src/template.html | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 src/fathom.js diff --git a/index.ts b/index.ts index adbef95..8412ae3 100644 --- a/index.ts +++ b/index.ts @@ -61,7 +61,13 @@ function writeTemplate( ) { const outputFile = join(BUILD_DIR, value, 'index.html'); mkdirp.sync(dirname(outputFile)); - writeFileSync(outputFile, template(context).replace(NEW_LINES_RE, '')); + writeFileSync( + outputFile, + template({ + ...context, + outputUrl: encodeURIComponent(`https://givemoneyto.me/${value}/`), + }).replace(NEW_LINES_RE, '') + ); } function writeRedirects(redirects: ReadonlyArray) { diff --git a/src/fathom.js b/src/fathom.js deleted file mode 100644 index bdec724..0000000 --- a/src/fathom.js +++ /dev/null @@ -1,12 +0,0 @@ -(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, '//fathom.theorangeone.net/tracker.js', 'fathom'); - -fathom('set', 'siteId', 'GOWOM'); -fathom('trackPageview'); diff --git a/src/template.html b/src/template.html index 7258245..7728d14 100644 --- a/src/template.html +++ b/src/template.html @@ -20,6 +20,6 @@ - +