Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Bakes contents, templates, scripts, and styles together

        def bake(config, minify):
    """Bakes contents, templates, scripts, and styles together"""
    params = {"title": config['title']}
    contents_data = contents.load(config)
    dynamic_templates = templates.load(config)
    lambdas_data = lambdas.load(config, contents_data, dynamic_templates)

    style, script = mix(config)

    logger.info('Baking contents and templates')
    contents.bake(config, contents_data, lambdas_data)
    templates.bake(config, dynamic_templates, lambdas_data)

    params.update({"json_data": json.dumps(contents_data + dynamic_templates)})

    logger.info('Baking styles and scripts')
    if minify:
        params.update({"style_sheet": cssmin.cssmin(style), "script": jsmin.jsmin(script)})
        params.update({"style_sheet": style, "script": script})

    logger.info('Baking lambdas')
    params.update({"config": config})

    logger.info('Compiling assets into an index page')
    pie = merge_pages(config, templates.get_index(config), params)
    build_index_html(pie, config)

    return pie

src/f/r/frozen-pie-HEAD/pie-test/tests.py   frozen-pie(Download)
    def test_bake(self):
        res = pie.bake(self.config, False)
        assert res != None
        assert "<style" in res
        assert "<script>" in res