def render_static(out, name, path): """ Write out a static template. out: a file-like object name: name of the template path: array of directories to search for the template """ # Reuse the tenjin logic for finding the template template_filename = tenjin.FileSystemLoader().find(name, path) if not template_filename: raise ValueError("template %s not found" % name) with open(template_filename) as infile: out.write(infile.read())
def before(self): self.loader = tenjin.FileSystemLoader() self.dirs = ['_views/blog', '_views']