def index(): posts = [page for page in pages if 'published' in page.meta] sorted_posts = sorted(posts, reverse=True, key=lambda page: page.meta['published']) return render_theme_template(get_current_theme(), 'index.html', posts=sorted_posts)
def post(path): page = pages.get_or_404(path) return render_theme_template(get_current_theme(), 'post.html', post=page)