pelicanconf.py

changeset 146
11e6db4102f1
parent 142
6faac5ee8017
child 147
6b6c2254dac1
--- a/pelicanconf.py	Thu Nov 10 18:52:14 2022 +0100
+++ b/pelicanconf.py	Thu Nov 10 19:15:24 2022 +0100
@@ -3,7 +3,7 @@
 from __future__ import unicode_literals
 import socket
 
-isprod = socket.gethostname() == 'sd-56079'
+isprod = socket.gethostname() == 'sdfa3'
 
 AUTHOR = u'David Douard'
 SITENAME = u'Whatever'
@@ -15,26 +15,30 @@
 
 if isprod:
     SITEURL = 'https://whatever.sdfa3.org'
-    PIWIK = '''
+    MATOMO_JS = '''
 <!-- Matomo -->
-<script type="text/javascript">
-  var _paq = window._paq || [];
+<script>
+  var _paq = window._paq = window._paq || [];
   /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
   _paq.push(['trackPageView']);
   _paq.push(['enableLinkTracking']);
   (function() {
-    var u="https://piwik.sdfa3.org/";
+    var u="//matomo.sdfa3.org/";
     _paq.push(['setTrackerUrl', u+'matomo.php']);
     _paq.push(['setSiteId', '2']);
     var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
-    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
   })();
 </script>
 <!-- End Matomo Code -->
     '''
+    MATOMO_IMG = '''
+  <img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.sdfa3.org/matomo.php?idsite=2&amp;rec=1" style="border:0" alt="" />
+  '''
 else:
     SITEURL = ''
-    PIWIK = ''
+    MATOMO_JS = ''
+    MATOMO_IMG = ''
 
 PATH = 'content'
 

mercurial