You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2022/03/15 09:10:07 UTC

[sling-site] branch master updated: SLING-11204 enable web analytics with ASF Matomo (#88)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/master by this push:
     new a97fbc6  SLING-11204 enable web analytics with ASF Matomo (#88)
a97fbc6 is described below

commit a97fbc663d621f82f3027e37b52668545dd278fa
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Mar 15 10:04:17 2022 +0100

    SLING-11204 enable web analytics with ASF Matomo (#88)
---
 src/main/jbake/templates/footer.tpl | 15 +++++++++++----
 src/main/jbake/templates/header.tpl | 19 +++++++++++++++++++
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/src/main/jbake/templates/footer.tpl b/src/main/jbake/templates/footer.tpl
index 6eebaf5..82363ab 100644
--- a/src/main/jbake/templates/footer.tpl
+++ b/src/main/jbake/templates/footer.tpl
@@ -1,11 +1,18 @@
 import java.text.SimpleDateFormat
 
 p() {
-    yield "Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project "
-    yield "logo are trademarks of The Apache Software Foundation. All other marks mentioned "
-    yield "may be trademarks or registered trademarks of their respective owners."
+    yield '''Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+    logo are trademarks of The Apache Software Foundation. All other marks mentioned 
+    may be trademarks or registered trademarks of their respective owners.'''
 }
 p() {
     String currentYear = new SimpleDateFormat("YYYY").format(new Date())
-    yield "Copyright \u00a9 2007-${currentYear} The Apache Software Foundation."
+    yield "Copyright \u00a9 2007-${currentYear}"
+    a(href:'https://www.apache.org/') {
+        yield 'The Apache Software Foundation'
+    }
+    yield '|'
+    a(href:'https://privacy.apache.org/policies/privacy-policy-public.html') {
+        yield 'Privacy Policy'
+    }
 }
diff --git a/src/main/jbake/templates/header.tpl b/src/main/jbake/templates/header.tpl
index dcf993e..6b18d31 100644
--- a/src/main/jbake/templates/header.tpl
+++ b/src/main/jbake/templates/header.tpl
@@ -16,4 +16,23 @@ head {
 	script {
 		yield 'hljs.initHighlightingOnLoad();'
 	} newLine()
+	yieldUnescaped '''
+	<!-- Matomo Web Analytics -->
+	<script>
+	var _paq = window._paq = window._paq || [];
+	/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+	/* We explicitly disable cookie tracking to avoid privacy issues */
+	_paq.push(['disableCookies']); 
+	_paq.push(['trackPageView']);
+	_paq.push(['enableLinkTracking']);
+	(function() {
+	  var u="https://matomo.privacy.apache.org/";
+	  _paq.push(['setTrackerUrl', u+'matomo.php']);
+	  _paq.push(['setSiteId', '6']);
+	  var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+	  g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+	})();
+	</script>
+	<!-- End Matomo Code -->
+	'''
 }
\ No newline at end of file