def get_page(request, current_url, website):
    """Looks up the current page and its title in the page configuration."""
    page = {}
    title = 'Untitled'

    if request.matched_route:
        rname = request.matched_route.name
        try:
            title, page = next(
                (t, p) for t, p in website['pages'].items()
                if rname == p.get('route')
            )
        except StopIteration:
            # Yield the default page/title above
            pass

    return dict(page, title=title)