47 lines
1.8 KiB
HTML
47 lines
1.8 KiB
HTML
{% set posts = __SELF__.posts %}
|
|
|
|
<ul class="post-list">
|
|
{% for post in posts %}
|
|
<li>
|
|
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
|
|
|
|
<p class="info">
|
|
{% if post.categories.count %}
|
|
{% set categoryLinks = post.categories | map(c => "<a href=\"#{c.url}\">#{c.name}</a>") | join(', ') %}
|
|
|
|
{{ 'rainlab.blog::lang.post.posted_byline' | trans({
|
|
date: post.published_at | date('rainlab.blog::lang.post.date_format' | trans),
|
|
categories: categoryLinks
|
|
}) }}
|
|
{% else %}
|
|
{{ 'rainlab.blog::lang.post.posted_byline_no_categories' | trans({
|
|
date: post.published_at | date('rainlab.blog::lang.post.date_format' | trans)
|
|
}) }}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p class="excerpt">{{ post.summary | raw }}</p>
|
|
</li>
|
|
{% else %}
|
|
<li class="no-data">{{ __SELF__.noPostsMessage }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
{% if posts.lastPage > 1 %}
|
|
<ul class="pagination">
|
|
{% if posts.currentPage > 1 %}
|
|
<li><a href="{{ this.page.baseFileName | page({ (__SELF__.pageParam): (posts.currentPage-1) }) }}">← Prev</a></li>
|
|
{% endif %}
|
|
|
|
{% for page in 1..posts.lastPage %}
|
|
<li class="{{ posts.currentPage == page ? 'active' : null }}">
|
|
<a href="{{ this.page.baseFileName | page({ (__SELF__.pageParam): page }) }}">{{ page }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
|
|
{% if posts.lastPage > posts.currentPage %}
|
|
<li><a href="{{ this.page.baseFileName | page({ (__SELF__.pageParam): (posts.currentPage+1) }) }}">Next →</a></li>
|
|
{% endif %}
|
|
</ul>
|
|
{% endif %}
|