Correction of links problem thanks to param BLOG_URL

This commit is contained in:
Phyks 2013-07-22 11:25:28 +02:00
parent 5b7dad4a78
commit 75256cc756
2 changed files with 4 additions and 3 deletions

1
TODO
View File

@ -6,5 +6,4 @@ Flake8 the whole thing ! :)
Known bugs :
===========
On article / tag pages : links are relative and don't work
@titre not remplaced

View File

@ -316,10 +316,12 @@ try:
header = header_fh.read()
tags_header = "<ul>"
for tag in tags:
tags_header += "<li><a href=\""+tag[4:-4]+".html\">"+tag[9:-4]+"</a></li>"
tags_header += "<li><a href=\""+params["BLOG_URL"]+tag[4:-4]+".html\">"+tag[9:-4]+"</a></li>"
tags_header += "</ul>"
header = header.replace("@categories", tags_header, 1)
header = header.replace("@blog_url", params["BLOG_URL"], 1)
#Articles
latest_articles_list = latest_articles("gen/", 5)
articles_header = "<ul>"
@ -333,7 +335,7 @@ try:
title_pos = line.find("@title=")
title = line[title_pos+7:]
articles_header += "<li><a href=\""+article[4:-4]+".html\">"+title+"</a></li>"
articles_header += "<li><a href=\""+params["BLOG_URL"]+article[4:-4]+".html\">"+title+"</a></li>"
except IOError:
sys.exit("[ERROR] Unable to open file "+article+".")
articles_header += "</ul>"