How to use the staticjinja.staticjinja.Site function in staticjinja

To help you get started, we’ve selected a few staticjinja examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Ceasar / staticjinja / staticjinja / staticjinja.py View on Github external
"""
        self.render_templates(self.templates)
        self.copy_static(self.static_names)

        if use_reloader:
            self.logger.info("Watching '%s' for changes..." %
                             self.searchpath)
            self.logger.info("Press Ctrl+C to stop.")
            Reloader(self).watch()

    def __repr__(self):
        return "%s('%s', '%s')" % (type(self).__name__,
                                   self.searchpath, self.outpath)


class Renderer(Site):
    def __init__(self, *args, **kwargs):
        warnings.warn("Renderer was renamed to Site.")
        super(Renderer, Site).__init__(*args, **kwargs)

    def run(self, use_reloader=False):
        return self.render(use_reloader)


def make_site(searchpath="templates",
              outpath=".",
              contexts=None,
              rules=None,
              encoding="utf8",
              followlinks=True,
              extensions=None,
              staticpaths=None,