Ver código fonte

Remove the sidebar HTML code from the renderer

This code is now found in a mini-template included
in base.html and archive_index.html.
Oz Nahum 11 anos atrás
pai
commit
02e029e97d
4 arquivos alterados com 25 adições e 28 exclusões
  1. 0 26
      blogit.py
  2. 1 1
      templates/archive_index.html
  3. 2 1
      templates/base.html
  4. 22 0
      templates/sidebar.html

+ 0 - 26
blogit.py

@@ -1,6 +1,4 @@
 #!/usr/bin/env python
-# -*- coding: utf-8
-
 
 # Copyleft (C) 2010 Mir Nazim <hello@mirnazim.org>
 # Copyleft (C) 2013 Oz Nahum <nahumoz@gmail.com>
@@ -77,30 +75,6 @@ GLOBAL_TEMPLATE_CONTEXT = {
     'twitter': 'https://twitter.com/#!/OzNTiram',
     'stackoverflow': "http://stackoverflow.com/users/492620/oz123",
     'github': "https://github.com/oz123",
-    'side_bar': """
-<div id="nav">
-  <div><img src="/media/img/me.png"></div>
-  <a title="Home" href="/">home</a>
-  <a title="About" class="about" href="/about.html">about</a>
-  <a title="Archive" class="archive" href="/archive">archive</a>
-  <a title="Atom feeds" href="/atom.xml">atom</a>
-  <a title="Twitter" href="https://twitter.com/#!/OzNTiram">twitter</a>
-  <a title="Stackoverflow" href="http://stackoverflow.com/users/492620/oz123">stackoverflow</a>
-  <a title="Github" href="https://github.com/oz123">github</a>
-  <script type="text/javascript"><!--
-      google_ad_client = "ca-pub-2570499281263620";
-      /* new_tower_for_oz123githubcom */
-      google_ad_slot = "8107518414";
-      google_ad_width = 120;
-      google_ad_height = 600;
-      //-->
-  </script>
-  <script type="text/javascript"
-      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-  </script>
-
-</div>
-    """,
     'google_analytics': """
 <script type="text/javascript">
   var _gaq = _gaq || [];

+ 1 - 1
templates/archive_index.html

@@ -26,8 +26,8 @@ margin-right:800px;
     <p class="margin">{{ entry.published_html }} <a title="{{ permalink }}" href="{{entry.permalink}}"> {{ entry.title }}</a> </p>
   {% endfor %}
 {% endblock %}
+{% include 'sidebar.html' %}
 
-{{side_bar}}
 {{google_analytics}}
 
 

+ 2 - 1
templates/base.html

@@ -28,7 +28,8 @@
     <p>&copy; Oz Nahum Tiram 2012. Some Rights Reserved</p>
   </div>
 </div>
-{{side_bar}}
+
+{% include 'sidebar.html' %}
 {{google_analytics}}
 </body>
 </html>

+ 22 - 0
templates/sidebar.html

@@ -0,0 +1,22 @@
+
+<div id="nav">
+  <div><img src="/media/img/me.png"></div>
+  <a title="Home" href="/">home</a>
+  <a title="About" class="about" href="/about.html">about</a>
+  <a title="Archive" class="archive" href="/archive">archive</a>
+  <a title="Atom feeds" href="/atom.xml">atom</a>
+  <a title="Twitter" href="https://twitter.com/#!/OzNTiram">twitter</a>
+  <a title="Stackoverflow" href="http://stackoverflow.com/users/492620/oz123">stackoverflow</a>
+  <a title="Github" href="https://github.com/oz123">github</a>
+  <script type="text/javascript"><!--
+      google_ad_client = "ca-pub-2570499281263620";
+      /* new_tower_for_oz123githubcom */
+      google_ad_slot = "8107518414";
+      google_ad_width = 120;
+      google_ad_height = 600;
+      //-->
+  </script>
+  <script type="text/javascript"
+      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+  </script>
+</div>