예제 #1
0
def blog_post(slug):
    # Whole-ass getting the post:
    try:
        post = filter(lambda x: x["slug"] == slug, build_posts(current_app.config["BLOG_DIR"]))
    except OSError:
        abort(404)

    if len(post) != 1:
        abort(404)

    return render_template("blog_post.html", post=post[0])
예제 #2
0
def blog_post(slug):
    # Whole-ass getting the post:
    try:
        def s(x):
            return x["slug"] == slug
        post = filter(s, build_posts(current_app.config["BLOG_DIR"]))
    except OSError:
        abort(404)

    if len(post) != 1:
        abort(404)

    return render_template("blog_post.html", post=post[0])
예제 #3
0
def blog():
    try:
        posts = build_posts(current_app.config["BLOG_DIR"])
    except OSError:
        return redirect(url_for('merveilles.root'))
    return render_template("blog.html", posts=posts)