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)
def archives(): blog_lists, blognum = get_blogs("blogs/") return render_templates("archives.htm", blogs=blog_lists)
def server_error(error): return render_templates("500.htm")
def page_not_found(error): return render_templates("404.htm")
def viewtopic(filename): file_path = 'topics/' + filename + '.md' topicinfo = get_topic(file_path) return render_templates("topic.htm",topics = topicinfo)
def viewpost(filename): file_path = 'blogs/' + filename + '.md' bloginfo = get_post(file_path) return render_templates("posts.htm", blog=bloginfo)