aboutsummaryrefslogtreecommitdiffstats
path: root/blogthon.cgi
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-03-02 17:06:22 +0100
committerStefan Ritter <xeno@thehappy.de>2009-03-02 17:06:22 +0100
commit3f689068b37923eb768e87ce0f52bfa2720756ce (patch)
treee52525260d843e94b68c3495a26a0c87898bcb4a /blogthon.cgi
parent6ec1a0bae938440a6dae440930e364104d92f8ff (diff)
Added a linklist to the sidebar
Diffstat (limited to 'blogthon.cgi')
-rwxr-xr-xblogthon.cgi19
1 files changed, 15 insertions, 4 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index c82aa3a..8488393 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -28,6 +28,7 @@ style = configuration.get('look', 'style')
entries_per_page = configuration.getint('look', 'entries_per_page')
monthlist = configuration.get('look', 'monthlist')
staticpages = configuration.get('look', 'staticpages')
+linklist = configuration.get('look', 'linklist')
permalinks = configuration.get('look', 'permalinks')
newest_first = configuration.get('look', 'newest_first')
@@ -75,27 +76,37 @@ if staticpages:
staticpages = []
staticpages_list = glob.glob(staticpages_dir + '*')
staticpages_list.sort()
- print ' <div class="staticpages">'
+ print ' <div class="sidebarentry">'
print ' <small>pages</small><br />'
for staticpage in staticpages_list:
title = re.sub('\w+?\/\d+?-', '', staticpage)
link = re.sub('\w+?\/', '', staticpage)
print ' &nbsp;<a href="?s=' + link + '">' + title + '</a>&nbsp;<br />'
- if monthlist and staticpages_list != []: print ' <br />'
+ if monthlist: print ' <br />'
print ' </div>'
if monthlist:
olddate = ""
- print ' <div class="monthlist">'
+ print ' <div class="sidebarentry">'
print ' <small>months</small><br />'
for entry in entries:
date = time.strftime("%m%Y", entry[0])
date_display = time.strftime("%h %Y", entry[0])
if not olddate == date:
- print ' <a href="?m=' + date + '">' + date_display + '</a><br />'
+ print ' &nbsp;<a href="?m=' + date + '">' + date_display + '</a>&nbsp;<br />'
olddate = date
+ if linklist: print ' <br />'
print ' </div>'
+if linklist:
+ content = open("linklist", "r")
+ print ' <div class="sidebarentry">'
+ print ' <small>links</small><br />'
+ for line in content:
+ print ' &nbsp;<a href=' + line.split(" ")[0] + '>' + line.split(" ")[-1].strip() + '</a>&nbsp;<br />'
+ print ' </div>'
+ content.close()
+
print ' </div>'
print ' <div class="content">'