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
This commit is contained in:
Gregory Soutade 2013-11-07 20:37:47 +01:00
parent f66feb4dbe
commit 93f9ff8a57
3 changed files with 55 additions and 40 deletions

View File

@ -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)))

View File

@ -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)

View File

@ -11,18 +11,18 @@
<link href="/css/blog.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="/js/base64.js"></script>
<script language="javascript" type="text/javascript" >
<!--
function decryptBase64()
{
var elements = document.getElementsByClassName("decode64");
for(var i=0; i<elements.length; i++)
{
<!--
function decryptBase64()
{
var elements = document.getElementsByClassName("decode64");
for(var i=0; i<elements.length; i++)
{
content = elements[i].innerHTML;
decoded = Base64.decode(content);
elements[i].innerHTML = decoded;
}
}
-->
}
}
-->
</script>
</head>
<body onLoad="decryptBase64();">
@ -47,40 +47,54 @@
<div class="menu_content_header">Recherche</div>
<div id="menu_main">
<dyn:replace div_name="form" id="search_form" method="POST" action="/search/dyn:blog_id">
<input type="text" name="text" onkeypress="handleKeyPress(event,this.form)"/>
<input type="text" name="text" id="search_text" onkeypress="handleKeyPress(event,this.form)"/>
</dyn:replace>
</div>
</div>
<div class="menu_content">
<div class="menu_content_header">Menu principal</div>
<div id="menu_main">
<div class="menu_content_content"><a href="/">Première page</a></div>
<div class="menu_content_content"><a href="/about.html">À propos</a></div>
<div class="menu_content_content"><a href="http://indefero.soutade.fr">Projets personnels</a></div>
</div>
</div>
<div class="menu_content">
<div class="menu_content_header">Catégories</div>
<div class="menu_content_content">
<ul>
<li><a href="/category/cinema">Cinéma</a></li>
<li><a href="/category/posts">Articles</a></li>
<li><a href="/category/musique">Musique</a></li>
<li><a href="/category/configurations-pc">Configurations PC</a></li>
</ul>
<nav>
<div class="menu_content">
<div class="menu_content_header">Menu principal</div>
<div id="menu_main">
<div class="menu_content_content"><a href="/">Première page</a></div>
<div class="menu_content_content"><a href="/about.html">À propos</a></div>
<div class="menu_content_content"><a href="/all_posts.html">Tous les articles</a></div>
<div class="menu_content_content"><a href="http://indefero.soutade.fr">Projets personnels</a></div>
</div>
</div>
</div>
<div class="menu_content">
<div class="menu_content_header">Archives</div>
<div class="menu_content_content">
<ul>
<li><a href="/archive/2012">2012</a></li>
<li><a href="/archive/2011">2011</a></li>
<li><a href="/archive/2010">2010</a></li>
</ul>
<div class="menu_content">
<div class="menu_content_header">Catégories</div>
<div class="menu_content_content">
<ul>
<li><a href="/category/cinema">Cinéma</a></li>
<li><a href="/category/articles">Articles</a></li>
<li><a href="/category/musique">Musique</a></li>
<li><a href="/category/configurations-pc">Configurations PC</a></li>
</ul>
</div>
</div>
</div>
<p style="align:text-center">Généré avec <a href="http://indefero.soutade.fr/p/dynastie">Dynastie</a></p>
<div class="menu_content">
<div class="menu_content_header">Tags</div>
<div class="menu_content_content">
<ul>
<li><a href="/tag/programmation">Programmation</a></li>
<li><a href="/tag/python">Python</a></li>
<li><a href="/tag/kisscount">KissCount</a></li>
<li><a href="/tag/jm2l">JM2L</a></li>
<li><a href="/tag/course-a-pied">Course à pied</a></li>
</ul>
</div>
</div>
<div class="menu_content">
<div class="menu_content_header">Archives</div>
<div class="menu_content_content">
<ul>
<li><a href="/archive/2012">2012</a></li>
<li><a href="/archive/2011">2011</a></li>
<li><a href="/archive/2010">2010</a></li>
</ul>
</div>
</div>
<p style="align:text-center">Généré avec <a href="http://indefero.soutade.fr/p/dynastie">Dynastie</a></p>
</div>
</div>
<div class="footer">