aboutsummaryrefslogtreecommitdiffstats
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
parent6ec1a0bae938440a6dae440930e364104d92f8ff (diff)
Added a linklist to the sidebar
-rwxr-xr-xblogthon.cgi19
-rw-r--r--configuration1
-rw-r--r--linklist1
-rw-r--r--styles/blogthon.css10
4 files changed, 18 insertions, 13 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">'
diff --git a/configuration b/configuration
index 68c0285..a468d70 100644
--- a/configuration
+++ b/configuration
@@ -10,5 +10,6 @@ style: blogthon.css
entries_per_page: 20
monthlist: True
staticpages: True
+linklist: True
permalinks: True
newest_first: True
diff --git a/linklist b/linklist
new file mode 100644
index 0000000..dd5449c
--- /dev/null
+++ b/linklist
@@ -0,0 +1 @@
+http://www.thehappy.de thehappy.de
diff --git a/styles/blogthon.css b/styles/blogthon.css
index 7d7568f..ecaaa63 100644
--- a/styles/blogthon.css
+++ b/styles/blogthon.css
@@ -64,15 +64,7 @@ a.entrytitle:link, a.entrytitle:hover, a.entrytitle:visited, a.entrytitle:active
background: #0F0;
}
-.monthlist {
- font-family: Verdana;
- font-size: 12px;
- color: #5577BB;
- text-align: center;
- background: #111;
-}
-
-.staticpages {
+.sidebarentry {
font-family: Verdana;
font-size: 12px;
color: #5577BB;