Update for markdown support

This commit is contained in:
Phyks 2014-08-01 00:45:47 +02:00
parent 2d1cc39d68
commit 0ef7a576e4

View File

@ -719,7 +719,7 @@ for filename in added_files+modified_files:
"\t</aside>\n" "\t</aside>\n"
"\t<div class=\"article\">\n" "\t<div class=\"article\">\n"
"\t\t<header><h1 class=\"article_title\"><a " + "\t\t<header><h1 class=\"article_title\"><a " +
"href=\""+params["BLOG_URL"]+"/"+filename[4:] + "href=\""+params["BLOG_URL"]+"/"+filename[4:filename.rfind('.')]+'.html' +
"\">"+title+"</a></h1></header>\n" "\">"+title+"</a></h1></header>\n"
"\t\t"+article+"\n" "\t\t"+article+"\n"
"\t\t<footer><p class=\"date\">"+date_readable + "\t\t<footer><p class=\"date\">"+date_readable +
@ -934,13 +934,13 @@ for article in added_files+modified_files:
content = header.replace("@title", params["BLOG_TITLE"] + " - " + content = header.replace("@title", params["BLOG_TITLE"] + " - " +
title, 1) + content + footer title, 1) + content + footer
try: try:
auto_dir("blog/"+article[4:]) auto_dir("blog/"+article[4:article.rfind('.')]+'.html')
with open("blog/"+article[4:], "w") as article_fh: with open("blog/"+article[4:article.rfind('.')]+'.html', "w") as article_fh:
article_fh.write(content) article_fh.write(content)
print("[INFO] (GEN ARTICLES) HTML file generated in blog dir for " print("[INFO] (GEN ARTICLES) HTML file generated in blog dir for "
"article "+article[4:]+".") "article "+article[4:article.rfind('.')]+'.html'+".")
except IOError: except IOError:
sys.exit("[ERROR] Unable to write blog/"+article[4:]+" file.") sys.exit("[ERROR] Unable to write blog/"+article[4:article.rfind('.')]+'.html'+" file.")
# Regenerate pages for years / months # Regenerate pages for years / months
years_list.sort(reverse=True) years_list.sort(reverse=True)