Example #1
0
def do_crank(args):
    """ Cranks posts """

    crt_path = os.getcwd()

    if not glue.move_to_blag_root():
        print "You do not seem to be inside a blag!"
        os.chdir(crt_path)
        return 1

    if not glue.initvars():
        return 1

    posts = procposts.posts_list()

    for post in posts:
        logging.debug("Processing {}".format(post.path))
        processed_text = process(post)
        write_post(post, processed_text)
        copy_static(post)

    ip = make_index_page()
    write_page("out/index.html", ip);

    ap = make_archive_page()
    write_page("out/archive.html", ap);

    crank_pages()

    return 0
Example #2
0
def do_posts(args):
    """ List posts """
    
    crt_path = os.getcwd()

    if not glue.move_to_blag_root():
        print "You do not seem to be inside a blag."
        os.chdir(crt_path)
        return 1

    posts = procposts.posts_list()

    for post in posts:
        print "{}: {}".format(post.link(), post.title())

    os.chdir(crt_path)
    
    return 0