(f, data, output_dir)
return True
Create Static Pages
Create Static Pages
Create Static Pages
def GenStaticPage(f, data, output_dir):
    ''' Create Static Pages '''
    templateLoader = jinja2.FileSystemLoader(searchpath="/")
    templateEnv = jinja2.Environment(loader=templateLoader)
    template = templateEnv.get_template(f)
    tempVars = {'data': data}
    outputText = template.render(tempVars)
    outputText.encode('utf-8')
    # Create the page
    filedir = output_dir + "/" + data['url']
    filename = output_dir + "/" + data['url'] + "/index.html"
    createFile(filedir, filename, outputText)

    return True
def GenStaticPage ( f , data , output_dir ) : templateLoader = jinja2 . FileSystemLoader ( searchpath = "/" ) templateEnv = jinja2 . Environment ( loader = templateLoader ) template = templateEnv . get_template ( f ) tempVars = { 'data' : data } outputText = template . render ( tempVars ) outputText . encode ( 'utf-8' ) # Create the page filedir = output_dir + "/" + data [ 'url' ] filename = output_dir + "/" + data [ 'url' ] + "/index.html" createFile ( filedir , filename , outputText ) return True