Ejemplo n.º 1
0
def new(filepath, config, title, frontmatter):
    """
    Create a new content in the specified path
    """
    conf.load_config(config)
    new_command = NewCommand(filepath, title, frontmatter)
    new_command.run()
Ejemplo n.º 2
0
def publish(filepath, config):
    """
    Mark specific content as published
    """
    conf.load_config(config)
    command = PublishCommand(filepath)
    command.run()
Ejemplo n.º 3
0
def compilemessages(config):
    """
    Compiles .po files created by makemessages to .mo files for use with the built-in gettext support.
    """
    conf.load_config(config)
    compiler = CompileMessages()
    compiler.compile()
Ejemplo n.º 4
0
def makemessages(config):
    """
    Runs over the entire source tree of layouts directory and pulls out all strings marked for translation.
    It creates (or updates) a message file in the locales directory.
    After making changes to the messages files you need to compile them with compilemessages for use with the builtin gettext support.
    """
    conf.load_config(config)
    maker = MakeMessages()
    maker.run()
Ejemplo n.º 5
0
def watch(config, build_draft, build_future, build_expired, disable_sitemap,
          disable_rss, disable_search, remove_expired, clean_destination):
    """
    Watch filesystem for changes and recreate as needed
    """
    conf.load_config(config)
    conf.build_draft = build_draft
    conf.build_future = build_future
    conf.build_expired = build_expired
    conf.disable_search = disable_search
    conf.disable_sitemap = disable_sitemap
    conf.disable_rss = disable_rss
    conf.remove_expired = remove_expired
    conf.clean_destination = clean_destination
    watcher = Watcher()
    watcher.start()
Ejemplo n.º 6
0
def generate(config, build_draft, build_future, build_expired, disable_sitemap,
             disable_rss, disable_search, remove_expired, clean_destination):
    """
    Generate your site from your contents
    """
    conf.load_config(config)
    conf.build_draft = build_draft
    conf.build_future = build_future
    conf.build_expired = build_expired
    conf.disable_search = disable_search
    conf.disable_sitemap = disable_sitemap
    conf.disable_rss = disable_rss
    conf.remove_expired = remove_expired
    conf.clean_destination = clean_destination
    generator = Generator()
    generator.gen()
Ejemplo n.º 7
0
def server(config, build_draft, build_future, build_expired, disable_sitemap,
           disable_rss, disable_search, remove_expired, clean_destination,
           port):
    """
    Sitic provides its own webserver which builds and serves the site.
    It is a webserver with limited options.
    It is not recommended to use it in production, instead use more featured
    servers as nginx or apache.

    By default Sitic will also watch your files for any changes you make and
    automatically rebuild the site.
    """
    conf.load_config(config)
    conf.build_draft = build_draft
    conf.build_future = build_future
    conf.build_expired = build_expired
    conf.disable_search = disable_search
    conf.disable_sitemap = disable_sitemap
    conf.disable_rss = disable_rss
    conf.remove_expired = remove_expired
    conf.clean_destination = clean_destination
    server = Server(port)
    server.start()