diff options
Diffstat (limited to '')
-rwxr-xr-x | blogthon.cgi | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/blogthon.cgi b/blogthon.cgi index b7f54ec..9eb2ab6 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -332,21 +332,16 @@ else: print ' <div class="pages_list">' print ' <ul class="pages_list">' for staticpage in staticpages_list: - f = open(staticpage, 'r') - for line in f: - if line.split(':', 1)[0] == 'extern_link': - link = '' - extern_link = line.split(':', 1)[1].strip() - else: - link = re.sub('\w+?\/', '', staticpage) - extern_link = '' - break - f.close() - title = re.sub('\w+?\/\d+?-', '', staticpage) - if extern_link: - print ' <li class="pages_list_entry"><a href=' + link + '" class="pages_list_entry">' + extern_link + '</a></li>' + file = open(staticpage, 'r') + header = file.readline() + if header.split(':', 1)[0] == 'extern_link': + link = header.split(':', 1)[1].strip() else: - print ' <li class="pages_list_entry"><a href="?s=' + link + '" class="pages_list_entry">' + title + '</a></li>' + link = re.sub('\w+?\/', '', staticpage) + link = '?s=' + link + file.close() + title = re.sub('\w+?\/\d+?-', '', staticpage) + print ' <li class="pages_list_entry"><a href="' + link + '" class="pages_list_entry">' + title + '</a></li>' print ' </ul>' print ' </div>' print ' <div class="pages_footer"></div>' |