Răsfoiți Sursa

improve templates and clean up

 * made atom template more generic
 * removed method from Entry which was used only when rendering atom
   this functionality was added in the template
Oz N Tiram 9 ani în urmă
părinte
comite
2fcc3d4400
3 a modificat fișierele cu 10 adăugiri și 16 ștergeri
  1. 0 9
      blogit/blogit.py
  2. 1 1
      templates/archive_index.html
  3. 9 6
      templates/atom.xml

+ 0 - 9
blogit/blogit.py

@@ -234,13 +234,6 @@ class Entry(object):
     def title(self):
         return self.header['title']
 
-    @property
-    def summary_atom(self):
-        summarya = markdown2.markdown(self.header.get('summary', "").strip())
-        summarya = re.sub("<p>|</p>", "", summarya)
-        more = '<a href="%s"> continue reading...</a>' % (self.permalink)
-        return summarya+more
-
     @property
     def publish_date(self):
         try:
@@ -533,6 +526,4 @@ if __name__ == '__main__':  # pragma: no coverage
     main()
 
 # TODO:
-
-# Change font size of the tag in the index to 100%
 # Replace the fonts to CDN fonts (Roboto and some others)

+ 1 - 1
templates/archive_index.html

@@ -4,7 +4,7 @@
 <div class="archive index">
 <h2>This is an archive of everything posted here ...</h2>
   {% for entry in entries %}
-    <p class="post">{{ entry.publish_date}} <a title="../{{ entry.permalink }}" href="../{{entry.permalink}}">{{entry.title }}</a></p>
+    <p class="post">{{ entry.publish_date.strftime("%B %d, %Y") }} <a title="../{{ entry.permalink }}" href="../{{entry.permalink}}">{{entry.title }}</a></p>
   {% endfor %}
 </div>
 {% endblock content %}

+ 9 - 6
templates/atom.xml

@@ -2,9 +2,9 @@
 <feed xmlns="http://www.w3.org/2005/Atom">
 <title>Oz's Blog</title>
 <subtitle>Oz's weblog</subtitle>
-<link href="http://oz123.github.com/atom.xml" rel="self" />
-<link href="http://oz123.github.com/" />
-<id>http://oz123.github.com/atom.xml</id>
+<link href="{{site_url}}/atom.xml" rel="self" />
+<link href="{{site_url}}/" />
+<id>{{site_url}}/atom.xml</id>
 <updated>{{ last_build }}</updated>
 <author>
   <name>Oz Nahum Tiram</name>
@@ -13,10 +13,13 @@
 {% for entry in entries %}
 <entry>
   <title>{{ entry.title }}</title>
-  <link href="{{ entry.permalink }}" />
-  <id>{{ entry.destination }}</id>
+  <link href="{{site_url}}/{{ entry.permalink }}" />
+  <id>{{site_url}}{{ entry.destination.lstrip('.') }}</id>
   <content type="xhtml">
-    <div xmlns="http://www.w3.org/1999/xhtml">{{ entry.summary_atom }}</div>
+    <div xmlns="http://www.w3.org/1999/xhtml">
+    {{ entry.header.summary }}
+    <a href="{{site_url}}{{ entry.destination.lstrip('.')}}">continue reading...</a>
+    </div>
   </content>
   </entry>
 {% endfor %}