From 93f9ff8a5758eece6077ddef11a973fac95aca8c Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Thu, 7 Nov 2013 20:37:47 +0100 Subject: [PATCH] Fix a bug introduced in previous commit (list.reverse() does not return anything) Don't generate posts if they're not published Update about me --- generators/all_posts.py | 4 +- generators/post.py | 1 + sites/blog.soutade.fr/about.html | 90 ++++++++++++++++++-------------- 3 files changed, 55 insertions(+), 40 deletions(-) diff --git a/generators/all_posts.py b/generators/all_posts.py index 86ff91f..0927425 100644 --- a/generators/all_posts.py +++ b/generators/all_posts.py @@ -60,7 +60,7 @@ class AllPosts(Index): cur_posts.append(p) continue - cur_posts = cur_posts.reverse() + cur_posts.reverse() month_elem = self.createElement(dom, 'month') month_def = dom.createElement('month') @@ -82,7 +82,7 @@ class AllPosts(Index): # Last month if not month_elem is None and len(cur_posts) != 0: - cur_posts = cur_posts.reverse() + cur_posts.reverse() month_elem = self.createElement(dom, 'month') month_def = dom.createElement('month') month_def.appendChild(dom.createTextNode(cur_posts[0].creation_date.strftime(date_format))) diff --git a/generators/post.py b/generators/post.py index 7e84bbb..680716a 100644 --- a/generators/post.py +++ b/generators/post.py @@ -184,6 +184,7 @@ class Post(Index): impl = xml.dom.getDOMImplementation() for post in posts: + if not post.published: continue #print 'Generate ' + filename dom_ = impl.createDocument('', 'xml', None) dom_.replaceChild(dom.firstChild.cloneNode(0), dom_.firstChild) diff --git a/sites/blog.soutade.fr/about.html b/sites/blog.soutade.fr/about.html index 152af28..71abd07 100755 --- a/sites/blog.soutade.fr/about.html +++ b/sites/blog.soutade.fr/about.html @@ -11,18 +11,18 @@ @@ -47,40 +47,54 @@ - -