Added extern_link tag to static pages

This commit is contained in:
Stefan Ritter 2009-10-30 14:53:37 +01:00
parent 9aedd9142a
commit b56bc33a16

View File

@ -332,8 +332,15 @@ else:
print ' <div class="pages_list">' print ' <div class="pages_list">'
print ' <ul class="pages_list">' print ' <ul class="pages_list">'
for staticpage in staticpages_list: for staticpage in staticpages_list:
f = open(staticpages_dir + staticpage, 'r')
for line in f:
if line.split(':', 1)[0] == 'extern_link':
link = line.split(':', 1)[1].strip()
else:
link = re.sub('\w+?\/', '', staticpage)
break
f.close()
title = re.sub('\w+?\/\d+?-', '', staticpage) title = re.sub('\w+?\/\d+?-', '', staticpage)
link = re.sub('\w+?\/', '', staticpage)
print ' <li class="pages_list_entry"><a href="?s=' + link + '" class="pages_list_entry">' + title + '</a></li>' print ' <li class="pages_list_entry"><a href="?s=' + link + '" class="pages_list_entry">' + title + '</a></li>'
print ' </ul>' print ' </ul>'
print ' </div>' print ' </div>'