예제 #1
0
파일: views.py 프로젝트: dedaluz/jamiecurle
def blog_archive(year, month):
    key = 'blog_archive_%s_%s' % (year, month)
    posts = get_posts()
    tags = get_tags()
    dates = get_dates()
    archive_posts = []
    for post in posts:
        if post['created'].month == month and post['created'].year == year:
            archive_posts.append(post)
    return render_template('blog/archive.html', posts=archive_posts, tags=tags,
        dates=dates)
예제 #2
0
파일: views.py 프로젝트: dedaluz/jamiecurle
def blog_index():
    posts = get_posts()[:20]
    tags = get_tags()
    dates = get_dates()
    return render_template( 'blog/index.html', posts=posts, tags=tags,
        dates=dates)
예제 #3
0
파일: views.py 프로젝트: dedaluz/jamiecurle
def blog_tagged(tag):
    tags = get_tags()
    dates = get_dates()
    tagged_posts = [post for post in get_posts() if tag in post['tags']]
    return render_template('blog/tagged.html', tagged_posts=tagged_posts,
        tag=tag, tags=tags, dates=dates)