From owner-dev-commits-doc-all@freebsd.org Thu Jul 1 22:44:24 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D52D5654913 for ; Thu, 1 Jul 2021 22:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GGCvD5V1hz3Pgv; Thu, 1 Jul 2021 22:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4B1DE12; Thu, 1 Jul 2021 22:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 161MiOJ1043249; Thu, 1 Jul 2021 22:44:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 161MiOgR043248; Thu, 1 Jul 2021 22:44:24 GMT (envelope-from git) Date: Thu, 1 Jul 2021 22:44:24 GMT Message-Id: <202107012244.161MiOgR043248@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: "Danilo G. Baio" Subject: git: 09b36d7dd4 - main - Re-enable Google Analytics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dbaio X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09b36d7dd44df840ab4a1817b7d919fab8d8d8d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2021 22:44:24 -0000 The branch main has been updated by dbaio: URL: https://cgit.FreeBSD.org/doc/commit/?id=09b36d7dd44df840ab4a1817b7d919fab8d8d8d9 commit 09b36d7dd44df840ab4a1817b7d919fab8d8d8d9 Author: Danilo G. Baio AuthorDate: 2021-07-01 12:20:12 +0000 Commit: Danilo G. Baio CommitDate: 2021-07-01 22:39:49 +0000 Re-enable Google Analytics We lost that after the migration to Hugo/Asciidoctor. Reviewed by: carlavilla Approved by: doceng (with hat) Differential Revision: https://reviews.freebsd.org/D30978 --- .../themes/beastie/layouts/articles/baseof.html | 2 + .../themes/beastie/layouts/books/baseof.html | 2 + .../themes/beastie/layouts/partials/site-head.html | 1 + documentation/themes/beastie/static/js/google.js | 52 ++++++++++++++++++++++ .../themes/beastie/layouts/partials/site-head.html | 2 + 5 files changed, 59 insertions(+) diff --git a/documentation/themes/beastie/layouts/articles/baseof.html b/documentation/themes/beastie/layouts/articles/baseof.html index 552ece4ca6..80bebc87f0 100644 --- a/documentation/themes/beastie/layouts/articles/baseof.html +++ b/documentation/themes/beastie/layouts/articles/baseof.html @@ -43,6 +43,8 @@ } + +
diff --git a/documentation/themes/beastie/layouts/books/baseof.html b/documentation/themes/beastie/layouts/books/baseof.html index 1f70b7c22e..50e97a6ea3 100644 --- a/documentation/themes/beastie/layouts/books/baseof.html +++ b/documentation/themes/beastie/layouts/books/baseof.html @@ -43,6 +43,8 @@ } + +
diff --git a/documentation/themes/beastie/layouts/partials/site-head.html b/documentation/themes/beastie/layouts/partials/site-head.html index f8caeca139..41d83c1544 100644 --- a/documentation/themes/beastie/layouts/partials/site-head.html +++ b/documentation/themes/beastie/layouts/partials/site-head.html @@ -41,4 +41,5 @@ + diff --git a/documentation/themes/beastie/static/js/google.js b/documentation/themes/beastie/static/js/google.js new file mode 100644 index 0000000000..34bfefcc94 --- /dev/null +++ b/documentation/themes/beastie/static/js/google.js @@ -0,0 +1,52 @@ +/* $FreeBSD$ */ + +/* + * Please do not commit to this file without receiving review from + * webstats@FreeBSD.org. + */ + +/* Teach jslint the appropriate style rules. */ +/*jslint browser:true*/ + +var enable_ga = true; +var allow_track = true; + +var h = document.location.hostname; +/* + * Check that the hosting domain is actually a FreeBSD.org domain, so + * we don't accidentally obtain data from mirrors. + */ +var fbsdregex = /((docs|security|svnweb|cgit|wiki|www)\.freebsd\.org|google\.com)$/i; + +if (typeof navigator.doNotTrack !== "undefined" && (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1")) { + allow_track = false; +} + +if (enable_ga && allow_track && fbsdregex.test(h)) { + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-22767463-1']); + _gaq.push(['_setDomainName', 'freebsd.org']); + _gaq.push(['_setAllowHash', false]); + _gaq.push (['_gat._anonymizeIp']); + + /* + * If we ever want to track sites other than FreeBSD.org, + * uncomment the next line. + */ + //_gaq.push(['_setAllowLinker', true]); + // This is what we track + _gaq.push(['_trackPageview']); + _gaq.push(['_trackPageLoadTime']); + + ( function() { + var ga = document.createElement('script'); + ga.type = 'text/javascript'; + ga.async = true; + ga.src = 'https://ssl.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(ga, s); + + })(); + +} + diff --git a/website/themes/beastie/layouts/partials/site-head.html b/website/themes/beastie/layouts/partials/site-head.html index 11f858b53d..934dafe12d 100644 --- a/website/themes/beastie/layouts/partials/site-head.html +++ b/website/themes/beastie/layouts/partials/site-head.html @@ -16,4 +16,6 @@ + +