예제 #1
0
파일: cli.py 프로젝트: ibigbug/liquidluck
def init_post():
    ns.storage.projectdir = os.getcwd()
    postdir = os.path.join(ns.storage.projectdir, ns.site.postdir)
    for f in walk_dir(postdir):
        reader = detect_reader(f)
        if reader:
            post = reader.render()
            if post:
                # ignore invalid post
                ns.storage.posts.append(post)
        else:
            ns.storage.files.append(f)

    return ns
예제 #2
0
파일: cli.py 프로젝트: ibigbug/liquidluck
def init_post():
    ns.storage.projectdir = os.getcwd()
    postdir = os.path.join(ns.storage.projectdir,
                           ns.site.postdir)
    for f in walk_dir(postdir):
        reader = detect_reader(f)
        if reader:
            post = reader.render()
            if post:
                # ignore invalid post
                ns.storage.posts.append(post)
        else:
            ns.storage.files.append(f)

    return ns
예제 #3
0
파일: cli.py 프로젝트: kebot/liquidluck
def init_post():
    ns.storage.projectdir = os.getcwd()
    postdir = os.path.join(ns.storage.projectdir,
                           ns.site.postdir)
    for f in walk_dir(postdir):
        reader = detect_reader(f)
        if reader:
            post = reader.render()
            if post:
                # ignore invalid post
                ns.storage.posts.append(post)
        else:
            ns.storage.files.append(f)

    ns.storage.posts = sorted(
        ns.storage.posts, key=lambda o: o.date, reverse=True)
    ns.storage.public_posts = filter(
        lambda post: post.public, ns.storage.posts)
    return ns
예제 #4
0
def init_post():
    ns.storage.projectdir = os.getcwd()
    postdir = os.path.join(ns.storage.projectdir, ns.site.postdir)
    for f in walk_dir(postdir):
        reader = detect_reader(f)
        if reader:
            post = reader.render()
            if post:
                # ignore invalid post
                ns.storage.posts.append(post)
        else:
            ns.storage.files.append(f)

    ns.storage.posts = sorted(ns.storage.posts,
                              key=lambda o: o.date,
                              reverse=True)
    ns.storage.public_posts = filter(lambda post: post.public,
                                     ns.storage.posts)
    return ns