title = "Blog Category"
url = "/blog/category/:slug"
layout = "blog"

[blogPosts]
pageNumber = {{ :page }}
categoryFilter = {{ :slug }}
categoryPage = "blog/category"
postPage = "blog/post"
postsPerPage = 9
==
<?php
function onEnd()
{
    $this->title = $this->blogPosts->category->name;
    $this->page['heading'] = $this->blogPosts->category->name;
}
==
<section id="body" class="py-20 flex-grow">
    <div class="container max-w-screen-xl">
        <div class="block lg:flex lg:flex-row divide-x divide-gray-100">
            <div class="flew-grow-0 px-8 lg:w-2/12 xl:pr-0">
                {% partial 'blog/category-list' %}
            </div>

            <div class="flex-grow-0 px-8 mt-16 lg:w-10/12 lg:mt-0">
                {% if blogPosts.posts|length > 0 %}
                    <div class="grid grid-cols-3">
                        {% for post in blogPosts.posts %}
                            {% partial 'blog/post-listing' post=post %}
                        {% endfor %}
                    </div>
                {% else %}
                    {% partial 'ui/empty' title="No posts published." subtitle="Please check back later." %}
                {% endif %}
            </div>
        </div>
    </div>
</section>
