def get(self): posts = getAllParsedPosts() params = getSiteInfo() template_file_name = "index.html" self.render(template_file_name, posts = posts, params = params)
def generateIndex(): posts = markdown_parser.getAllParsedPosts() params = getSiteInfo() html = TemplateParser.parse(options.current_template_dir, "index.html", posts=posts, params=params) index_file = open("build/index.html", "wb") index_file.write(html)
def get(self): posts = getAllParsedPosts() params = getSiteInfo() template_file_name = "index.html" self.render(template_file_name, posts=posts, params=params)
def get(self): full_name = "about.markdown" post = BasicParser.parse(options.about_dir, full_name) post["title"] = options.author params = getSiteInfo() template_file_name = "about.html" self.render(template_file_name, post=post, params=params)
def get(self): uri = self.request.uri post_name = uri.split("/")[2] full_name = post_name.split(".")[0] + ".markdown" post = BasicParser.parse(options.posts_dir, full_name) params = getSiteInfo() template_file_name = "post.html" self.render(template_file_name, post = post, params = params)
def get(self): uri = self.request.uri post_name = uri.split("/")[2] full_name = post_name.split(".")[0] + ".markdown" post = BasicParser.parse(options.posts_dir, full_name) params = getSiteInfo() template_file_name = "post.html" self.render(template_file_name, post=post, params=params)
def generateAbout(): dest = options.build_dir + os.sep + "about" mkdir(dest) post = BasicParser.parse(options.about_dir, "about.markdown") post["title"] = options.author params = getSiteInfo() html = TemplateParser.parse(options.current_template_dir, "about.html", post=post, params=params) about_file = open(dest + os.sep + "index.html", "wb") about_file.write(html)
def generatePosts(): dest = options.build_dir + os.sep + "post" mkdir(dest) posts = markdown_parser.getAllParsedPosts(brief=False) params = getSiteInfo() for post in posts: html = TemplateParser.parse(options.current_template_dir, "post.html", post=post, params=params) post_file = open(dest + os.sep + post["post_name"] + ".html", "wb") post_file.write(html)