Added a linklist to the sidebar
This commit is contained in:
parent
6ec1a0bae9
commit
3f689068b3
19
blogthon.cgi
19
blogthon.cgi
@ -28,6 +28,7 @@ style = configuration.get('look', 'style')
|
|||||||
entries_per_page = configuration.getint('look', 'entries_per_page')
|
entries_per_page = configuration.getint('look', 'entries_per_page')
|
||||||
monthlist = configuration.get('look', 'monthlist')
|
monthlist = configuration.get('look', 'monthlist')
|
||||||
staticpages = configuration.get('look', 'staticpages')
|
staticpages = configuration.get('look', 'staticpages')
|
||||||
|
linklist = configuration.get('look', 'linklist')
|
||||||
permalinks = configuration.get('look', 'permalinks')
|
permalinks = configuration.get('look', 'permalinks')
|
||||||
newest_first = configuration.get('look', 'newest_first')
|
newest_first = configuration.get('look', 'newest_first')
|
||||||
|
|
||||||
@ -75,27 +76,37 @@ if staticpages:
|
|||||||
staticpages = []
|
staticpages = []
|
||||||
staticpages_list = glob.glob(staticpages_dir + '*')
|
staticpages_list = glob.glob(staticpages_dir + '*')
|
||||||
staticpages_list.sort()
|
staticpages_list.sort()
|
||||||
print ' <div class="staticpages">'
|
print ' <div class="sidebarentry">'
|
||||||
print ' <small>pages</small><br />'
|
print ' <small>pages</small><br />'
|
||||||
for staticpage in staticpages_list:
|
for staticpage in staticpages_list:
|
||||||
title = re.sub('\w+?\/\d+?-', '', staticpage)
|
title = re.sub('\w+?\/\d+?-', '', staticpage)
|
||||||
link = re.sub('\w+?\/', '', staticpage)
|
link = re.sub('\w+?\/', '', staticpage)
|
||||||
print ' <a href="?s=' + link + '">' + title + '</a> <br />'
|
print ' <a href="?s=' + link + '">' + title + '</a> <br />'
|
||||||
if monthlist and staticpages_list != []: print ' <br />'
|
if monthlist: print ' <br />'
|
||||||
print ' </div>'
|
print ' </div>'
|
||||||
|
|
||||||
if monthlist:
|
if monthlist:
|
||||||
olddate = ""
|
olddate = ""
|
||||||
print ' <div class="monthlist">'
|
print ' <div class="sidebarentry">'
|
||||||
print ' <small>months</small><br />'
|
print ' <small>months</small><br />'
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
date = time.strftime("%m%Y", entry[0])
|
date = time.strftime("%m%Y", entry[0])
|
||||||
date_display = time.strftime("%h %Y", entry[0])
|
date_display = time.strftime("%h %Y", entry[0])
|
||||||
if not olddate == date:
|
if not olddate == date:
|
||||||
print ' <a href="?m=' + date + '">' + date_display + '</a><br />'
|
print ' <a href="?m=' + date + '">' + date_display + '</a> <br />'
|
||||||
olddate = date
|
olddate = date
|
||||||
|
if linklist: print ' <br />'
|
||||||
print ' </div>'
|
print ' </div>'
|
||||||
|
|
||||||
|
if linklist:
|
||||||
|
content = open("linklist", "r")
|
||||||
|
print ' <div class="sidebarentry">'
|
||||||
|
print ' <small>links</small><br />'
|
||||||
|
for line in content:
|
||||||
|
print ' <a href=' + line.split(" ")[0] + '>' + line.split(" ")[-1].strip() + '</a> <br />'
|
||||||
|
print ' </div>'
|
||||||
|
content.close()
|
||||||
|
|
||||||
print ' </div>'
|
print ' </div>'
|
||||||
print ' <div class="content">'
|
print ' <div class="content">'
|
||||||
|
|
||||||
|
@ -10,5 +10,6 @@ style: blogthon.css
|
|||||||
entries_per_page: 20
|
entries_per_page: 20
|
||||||
monthlist: True
|
monthlist: True
|
||||||
staticpages: True
|
staticpages: True
|
||||||
|
linklist: True
|
||||||
permalinks: True
|
permalinks: True
|
||||||
newest_first: True
|
newest_first: True
|
||||||
|
@ -64,15 +64,7 @@ a.entrytitle:link, a.entrytitle:hover, a.entrytitle:visited, a.entrytitle:active
|
|||||||
background: #0F0;
|
background: #0F0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.monthlist {
|
.sidebarentry {
|
||||||
font-family: Verdana;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #5577BB;
|
|
||||||
text-align: center;
|
|
||||||
background: #111;
|
|
||||||
}
|
|
||||||
|
|
||||||
.staticpages {
|
|
||||||
font-family: Verdana;
|
font-family: Verdana;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #5577BB;
|
color: #5577BB;
|
||||||
|
Loading…
Reference in New Issue
Block a user