Mercurial > hg > nginx-site
changeset 543:9085f0c59dc6
Google Analytics tracking script added to all pages
author | Sergey Budnevitch <sb@waeme.net> |
---|---|
date | Wed, 20 Jun 2012 13:46:28 +0000 |
parents | a9e6a8613534 |
children | 1507ec5ba69a |
files | GNUmakefile xsls/article.xsls xsls/books.xsls xsls/download.xsls xsls/error.xsls xsls/ga.xsls xsls/news.xsls xsls/security.xsls |
diffstat | 8 files changed, 50 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/GNUmakefile Tue Jun 19 13:02:40 2012 +0000 +++ b/GNUmakefile Wed Jun 20 13:46:28 2012 +0000 @@ -48,6 +48,7 @@ xslt/body.xslt \ xslt/menu.xslt \ xslt/donate.xslt \ + xslt/ga.xslt \ xslt/directive.xslt \ xslt/content.xslt \ xslt/versions.xslt @@ -63,6 +64,7 @@ xslt/style.xslt \ xslt/body.xslt \ xslt/menu.xslt \ + xslt/ga.xslt \ xslt/content.xslt DOWNLOAD_DEPS = \ @@ -76,6 +78,7 @@ xslt/style.xslt \ xslt/body.xslt \ xslt/menu.xslt \ + xslt/ga.xslt \ xslt/content.xslt SECURITY_DEPS = \ @@ -89,6 +92,7 @@ xslt/style.xslt \ xslt/body.xslt \ xslt/menu.xslt \ + xslt/ga.xslt \ xslt/content.xslt BOOK_DEPS = \ @@ -102,6 +106,7 @@ xslt/style.xslt \ xslt/body.xslt \ xslt/menu.xslt \ + xslt/ga.xslt \ xslt/content.xslt LANGS = en ja he ru tr @@ -140,6 +145,7 @@ xml/menu.xml \ dtd/article.dtd \ dtd/content.dtd \ + xslt/ga.xslt \ xslt/error.xslt $(call XSLT, xslt/error.xslt, $<, $@)
--- a/xsls/article.xsls Tue Jun 19 13:02:40 2012 +0000 +++ b/xsls/article.xsls Wed Jun 20 13:46:28 2012 +0000 @@ -22,6 +22,7 @@ X:include href = "donate.xslt"; X:include href = "directive.xslt"; X:include href = "content.xslt"; +X:include href = "ga.xslt"; X:include href = "versions.xslt"; @@ -34,6 +35,8 @@ !style (lang="@lang") + !ga () + </head> !body (lang="@lang") @@ -51,6 +54,8 @@ !style (lang="@lang") + !ga () + </head> !body (lang="@lang")
--- a/xsls/books.xsls Tue Jun 19 13:02:40 2012 +0000 +++ b/xsls/books.xsls Wed Jun 20 13:46:28 2012 +0000 @@ -18,6 +18,7 @@ X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; +X:include href = "ga.xslt"; X:include href = "content.xslt"; @@ -28,6 +29,8 @@ !style (lang="@lang") + !ga () + </head> !body (lang="@lang")
--- a/xsls/download.xsls Tue Jun 19 13:02:40 2012 +0000 +++ b/xsls/download.xsls Wed Jun 20 13:46:28 2012 +0000 @@ -18,6 +18,7 @@ X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; +X:include href = "ga.xslt"; X:include href = "content.xslt"; @@ -28,6 +29,8 @@ !style (lang="@lang") + !ga () + </head> !body (lang="@lang")
--- a/xsls/error.xsls Tue Jun 19 13:02:40 2012 +0000 +++ b/xsls/error.xsls Wed Jun 20 13:46:28 2012 +0000 @@ -1,5 +1,7 @@ X:stylesheet { +X:include href = "ga.xslt"; + X:output method="html" version="4.0" indent="no" encoding="utf-8"; X:strip-space elements = "*"; @@ -18,6 +20,9 @@ body { font-family: Georgia, serif; } ') } </style> + + !ga () + </head> <body>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xsls/ga.xsls Wed Jun 20 13:46:28 2012 +0000 @@ -0,0 +1,22 @@ +X:stylesheet { + +X:template ga () { + + <script type="text/javascript"> + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-27974099-2']); + _gaq.push(['_setDomainName', 'nginx.org']); + _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> + +} + +}
--- a/xsls/news.xsls Tue Jun 19 13:02:40 2012 +0000 +++ b/xsls/news.xsls Wed Jun 20 13:46:28 2012 +0000 @@ -19,6 +19,7 @@ X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; +X:include href = "ga.xslt"; X:include href = "content.xslt"; @@ -32,6 +33,8 @@ !style (lang="@lang") + !ga () + </head> !body (lang="@lang")
--- a/xsls/security.xsls Tue Jun 19 13:02:40 2012 +0000 +++ b/xsls/security.xsls Wed Jun 20 13:46:28 2012 +0000 @@ -18,6 +18,7 @@ X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; +X:include href = "ga.xslt"; X:include href = "content.xslt"; @@ -28,6 +29,8 @@ !style (lang="@lang") + !ga () + </head> !body (lang="@lang")