paginate Tag
The paginate tag wraps content that may be paginated. It’s a structural tag used with paginated collections.
Syntax
Section titled “Syntax”{% paginate %} <!-- Paginated content here -->{% endpaginate %}Output
Section titled “Output”The tag renders its content directly without any wrapper elements. It serves as a semantic marker for paginated sections.
{% paginate %} {% for post in posts %} <article>{{ post.title }}</article> {% endfor %}{% endpaginate %}<article>Post Title 1</article><article>Post Title 2</article><article>Post Title 3</article>Example Usage
Section titled “Example Usage”Blog listing with pagination:
{# templates/blog.liquid #}<main class="blog-listing"> <h1>{{ blog.title }}</h1>
{% paginate %} <div class="posts-grid"> {% for post in posts %} <article class="post-card"> <h2><a href="/posts/{{ post.slug }}">{{ post.title }}</a></h2> <time>{{ post.publishDate | date: '%B %d, %Y' }}</time> <p>{{ post.description | truncate: 150 }}</p> </article> {% endfor %} </div> {% endpaginate %}</main>