示例#1
0
def default(page=1):
    blog_lists, blognum = get_blogs("blogs/")
    pages = get_page_lists(blognum, page)
    if page > 1:
        start = (page - 1) * PER_PAGE - 1
    else:
        start = 0
    end = page * PER_PAGE - 1
    return render_templates("index.htm",
                            blogs=blog_lists[start:end],
                            pages=pages)
示例#2
0
def archives():
    blog_lists, blognum = get_blogs("blogs/")
    return render_templates("archives.htm", blogs=blog_lists)
示例#3
0
 def server_error(error):
     return render_templates("500.htm")
示例#4
0
 def page_not_found(error):
     return render_templates("404.htm")
示例#5
0
def viewtopic(filename):
	file_path = 'topics/' + filename + '.md'
	topicinfo = get_topic(file_path)
	return render_templates("topic.htm",topics = topicinfo)
示例#6
0
def viewpost(filename):
    file_path = 'blogs/' + filename + '.md'
    bloginfo = get_post(file_path)
    return render_templates("posts.htm", blog=bloginfo)