- link_base = link.split('.')[0]
- if (link.endswith(".html")):
- langlink = addLangExt(link_base, lang, "html")
- line = line.replace(link, langlink)
- if (link.endswith(".pdf")):
- langlink = addLangExt(link_base, lang, "pdf")
- line = line.replace(link, langlink)
+ # questionable
+ if (not link.startswith("../doc/")):
+ if (link.endswith(".html")):
+ langlink = addLangExt(link[:-5], lang, "html")
+ line = line.replace(link, langlink)
+ if (link.endswith(".pdf")):
+ langlink = addLangExt(link[:-4], lang, "pdf")
+ line = line.replace(link, langlink)
+ ### add google tracker header
+ if (line.find("</head>") >= 0):
+ outfile.write("""<!-- Google tracking !-->
+<script type="text/javascript">
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-68969-1', 'auto');
+ ga('send', 'pageview');
+
+</script>
+""");
+ #### add google tracker goals
+ if (line.find("href=\"http://download.linuxaudio.org") >= 0):
+ # TODO: more ugly hardcoding to make releases hard. :(
+ if (line.find('2.16') >= 0):
+ line = line.replace('a href=', 'a onClick=\"javascript:urchinTracker(\'/download/v2.16\');\" href=')
+ elif (line.find('2.17') >= 0):
+ line = line.replace('a href=', 'a onClick=\"javascript:urchinTracker(\'/download/v2.17\');\" href=')