oz123 12 лет назад
Родитель
Сommit
4bbb953f71
4 измененных файлов с 28 добавлено и 3 удалено
  1. 14 2
      blogit.py
  2. 11 0
      templates/about.html
  3. 2 1
      templates/archive_index.html
  4. 1 0
      templates/base.html

+ 14 - 2
blogit.py

@@ -43,7 +43,7 @@ import yaml # in debian python-yaml
 from StringIO import StringIO
 import codecs
 from jinja2 import Environment, FileSystemLoader # in debian python-jinja2
-import markdown2
+import markdown as markdown2
 import argparse
 import sys
 from distutils import dir_util
@@ -79,7 +79,19 @@ GLOBAL_TEMPLATE_CONTEXT = {
   <a title="Stackoverflow" href="http://stackoverflow.com/users/492620/oz123">stackoverflow</a>
   <a title="Github" href="https://github.com/oz123">github</a>
 </div>
-                """
+    """,
+    'google_analytics':"""
+<script type="text/javascript">
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-36587163-1']);
+  _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>"""
 }
 
 KINDS = {

+ 11 - 0
templates/about.html

@@ -46,7 +46,18 @@
   <a title="Stackoverflow" href="http://stackoverflow.com/users/492620/oz123">stackoverflow</a>
   <a title="Github" href="https://github.com/oz123">github</a>
 </div>
+<script type="text/javascript">
 
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-36587163-1']);
+  _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>
 </body>
 </html>

+ 2 - 1
templates/archive_index.html

@@ -27,8 +27,9 @@ margin-right:800px;
   {% endfor %}
 {% endblock %}
 
-
 {{side_bar}}
+{{google_analytics}}
+
 
 </body>
 </html>

+ 1 - 0
templates/base.html

@@ -23,5 +23,6 @@
   </div>
 </div>
 {{side_bar}}
+{{google_analytics}}
 </body>
 </html>