/
home.html
40 lines (32 loc) · 1.32 KB
/
home.html
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
38
39
40
---
layout: default
---
<h1 class="post-list-header">مقالات</h1>
<ul class="post-list">
{% for post in paginator.posts %}
<li class="post-list-item">
<!--span class="meta date">{{ post.date | jdate: "%A %d %b %Y" | habify }}</span-->
<h2><a href="{{ post.url | absolute_url }}">{{ post.title }}</a></h2>
{{ post.content | strip_html | truncatewords: 35 }}
</li>
{% endfor %}
{% if paginator.total_pages > 1 %}
<nav class="a-pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}"><i class="fas fa-forward"></i></a>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<span class="is-active">{{ page | habify}}</span>
{% elsif page == 1 %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">{{ page | habify }}</a>
{% else %}
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page | habify }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}"><i class="fas fa-backward"></i></a>
{% endif %}
</nav>
{% endif %}
</ul>