blog/_includes/views/pagination.html

52 lines
1.6 KiB
HTML
Raw Normal View History

2019-09-11 06:19:34 +02:00
{%- if page.paginator -%}
{%- assign paginator = page.paginator -%}
{%- elsif paginator == nil -%}
{%- assign paginator = site -%}
{%- endif -%}
{%- if paginator.posts.size > 0 -%}
<div class="pagination">
<!-- Post list links -->
<ul class="post-list">
{%- for post in paginator.posts -%}
<li>
{%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}
2020-07-16 13:25:52 +02:00
{% assign article = post.content %}
{% assign lang = post.lang %}
2020-07-16 13:25:52 +02:00
{%- include functions.html func='get_reading_time' -%}
{% assign reading_time = return %}
{%- include functions.html func='get_article_excerpt' -%}
{% assign excerpt = return %}
{%- assign post_url = post.url | relative_url -%}
2020-07-16 13:25:52 +02:00
2020-07-12 10:23:23 +02:00
<h2 class="post-title">
2019-09-11 06:19:34 +02:00
<a class="post-link" href="{{ post_url }}">
{{ post.title | escape }}
</a>
2020-07-12 10:23:23 +02:00
</h2>
<div class="post-meta">
2020-07-16 13:25:52 +02:00
<span class="post-date"><i class="fa fa-calendar"></i> {{ post.date | date: date_format }}</span>
<span class="post-reading-time left-vsplit"><i class="fa fa-clock-o"></i> {{ reading_time }}</span>
2020-07-12 10:23:23 +02:00
</div>
<a class="post-excerpt" href="{{ post_url }}">
<p>
{{ excerpt }} <span class="read_more">Read More</span>
</p>
</a>
2020-07-12 10:23:23 +02:00
<div class="post-tags">
{%- for tag in post.tags -%}
<a class="post-tag" href="{{ '/tags.html ' | relative_url }}#{{tag}}">#{{tag}}</a>
2020-07-12 10:23:23 +02:00
{%- endfor -%}
</div>
2019-09-11 06:19:34 +02:00
</li>
{%- endfor -%}
</ul>
<!-- Pagination links -->
{%- if paginator.posts.size < site.posts.size -%}
{%- include views/paginator.html -%}
{%- endif -%}
</div>
{%- endif -%}