def page_index(request):
    """Index of all pages."""
    letters = {}
    for page in Page.query.order_by(Page.name):
        letters.setdefault(page.name.capitalize()[0], []).append(page)
    return Response(
        generate_template("page_index.html", letters=sorted(letters.items()))
    )