Creates directories for articles

This commit is contained in:
2012-07-22 17:28:17 +02:00
parent be306c6643
commit 765c3ad19b
2 changed files with 19 additions and 3 deletions

View File

@@ -52,7 +52,12 @@ class Article(DynastieGenerator):
#print 'Generate ' + filename
nodes = dom.getElementsByTagName("*")
self.parse(article, dom, nodes[0])
self.writeIfNotTheSame(output + '/articles/' + article.title_slug + '.html', nodes[0].toxml('utf8'))
filename = output + '/articles/'
filename = filename + article.creation_date.strftime("%Y") + '/' + article.creation_date.strftime("%m") + '/'
if not os.path.exists(filename):
os.makedirs(filename)
filename = filename + article.title_slug + '.html'
self.writeIfNotTheSame(filename, nodes[0].toxml('utf8'))
dom = parse(src + '/_article.html')
if not self.somethingWrote: