Added a linklist to the sidebar

This commit is contained in:
Stefan Ritter 2009-03-02 17:06:22 +01:00
parent 6ec1a0bae9
commit 3f689068b3
4 changed files with 18 additions and 13 deletions

View File

@ -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">'

View File

@ -10,5 +10,6 @@ style: blogthon.css
entries_per_page: 20
monthlist: True
staticpages: True
linklist: True
permalinks: True
newest_first: True

1
linklist Normal file
View File

@ -0,0 +1 @@
http://www.thehappy.de thehappy.de

View File

@ -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;