-
Notifications
You must be signed in to change notification settings - Fork 7
/
blogslist.njk
37 lines (33 loc) · 1.58 KB
/
blogslist.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<section class="block blogslist">
{% for blog in blogposts | trimArray(30) %}
<a href="{{ blog.url | url }}" class="card nostyle">
<div class="thumb" style="background-image: url({% Image blog.data.image, 'Image', false, '', true %})"></div>
<article>
<h4>{{ blog.data.title }}</h4>
<p>
{{ (blog.data.page.excerpt or blog.data.description) | truncate(250) }}
<div class="taglist flex">
{% for tag in blog.data.tags %}
<span class="post-tag">#{{ tag }}</span>
{% endfor %}
</div>
</p>
<div class="layout horizontal center">
<div class="flex">
<time datetime="{{ blog.date | dateFormat('yyyy-mm-dd') }}">{{ blog.date | dateFormat('MMM d, yyyy') }}</time>
</div>
<small class="bold">{% dotTag "Read More", "filled" %}</small>
</div>
</article>
</a>
{% endfor %}
</section>
{% if pagination.pages.length > 1 %}
<section class="block pagination layout horizontal around-justified flex wrap center-center" aria-labelledby="pagination">
{# <a href="{{ pagination.href.first }}"><< First</a> #}
<a class="icolink" href="{{ pagination.href.previous }}"{% if pagination.pageNumber == 0 %} disabled{% endif %}>{% svgico 'arrow-circle-left' %} Previous</a>
<span>Page {{ pagination.pageNumber + 1 }} of {{ pagination.pages.length }}</span>
<a class="icolink" href="{{ pagination.href.next }}"{% if pagination.pageNumber == pagination.pages.length - 1 %} disabled{% endif %}>Next {% svgico 'arrow-circle-right' %}</a>
{# <a href="{{ pagination.href.last }}">Last >></a> #}
</section>
{% endif %}