couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [24/50] documentation commit: updated refs/heads/import-master to fe7f7bf
Date Thu, 10 Jul 2014 09:47:23 GMT
Add GA tracking to docs, only when not local


Project: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/commit/5db4eed2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/tree/5db4eed2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/diff/5db4eed2

Branch: refs/heads/import-master
Commit: 5db4eed2af58e04fc76cb2f373a800cf9beca2ba
Parents: 9d61faf
Author: Noah Slater <nslater@tumbolia.org>
Authored: Thu Apr 10 12:45:40 2014 +0200
Committer: Noah Slater <nslater@tumbolia.org>
Committed: Thu Apr 10 12:45:40 2014 +0200

----------------------------------------------------------------------
 src/conf.py             |  5 ++++-
 templates/help.html     |  4 ++--
 templates/tracking.html | 15 +++++++++++++++
 3 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-documentation/blob/5db4eed2/src/conf.py
----------------------------------------------------------------------
diff --git a/src/conf.py b/src/conf.py
index 14a93f5..03c5dd6 100644
--- a/src/conf.py
+++ b/src/conf.py
@@ -106,7 +106,9 @@ html_additional_pages = {
     'index': 'pages/index.html'
 }
 
-html_context = {}
+html_context = {
+    "ga_code": "UA-658988-6"
+}
 
 html_sidebars = {
     "**": [
@@ -115,6 +117,7 @@ html_sidebars = {
         "relations.html",
         "utilities.html",
         "help.html",
+        "tracking.html",
     ]
 }
 

http://git-wip-us.apache.org/repos/asf/couchdb-documentation/blob/5db4eed2/templates/help.html
----------------------------------------------------------------------
diff --git a/templates/help.html b/templates/help.html
index be0cb91..a6b7859 100644
--- a/templates/help.html
+++ b/templates/help.html
@@ -16,9 +16,9 @@ specific language governing permissions and limitations under the License.
 <h3>More Help</h3>
 
 <ul>
-<li><a href="https://couchdb.apache.org/">Homepage</a></li>
+<li><a href="https://couchdb.apache.org/"{% if not local %} onclick="_gaq.push(['_link',
'https://couchdb.apache.org/']); return false;"{% endif %}>Homepage</a></li>
 <li><a href="http://wiki.apache.org/couchdb/">Wiki</a></li>
-<li><a href="https://couchdb.apache.org/#mailing-list">Mailing Lists</a></li>
+<li><a href="https://couchdb.apache.org/#mailing-list"{% if not local %} onclick="_gaq.push(['_link',
'https://couchdb.apache.org/#mailing-list']); return false;"{% endif %}>Mailing Lists</a></li>
 <li><a href="http://webchat.freenode.net/?channels=couchdb">IRC</a></li>
 <li><a href="https://issues.apache.org/jira/browse/CouchDB">Issues</a></li>
 <li><a href="{{ pathto('download') }}">Download</a></li>

http://git-wip-us.apache.org/repos/asf/couchdb-documentation/blob/5db4eed2/templates/tracking.html
----------------------------------------------------------------------
diff --git a/templates/tracking.html b/templates/tracking.html
new file mode 100644
index 0000000..e6d4037
--- /dev/null
+++ b/templates/tracking.html
@@ -0,0 +1,15 @@
+{% if not local %}
+<script type="text/javascript">
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', '{{ ga_code }}']);
+  _gaq.push(['_setDomainName', 'couchdb.org']);
+  _gaq.push(['_setAllowLinker', true]);
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+</script>
+{% endif %}


Mime
View raw message