_layouts/home.html in jekyll-theme-mehdix-rtl-0.2.4 vs _layouts/home.html in jekyll-theme-mehdix-rtl-1.0.0
- old
+ new
@@ -1,27 +1,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>
+ <!--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 %}
-</ul>
-<nav class="pagination">
- {% if paginator.previous_page %}
- <a href="{{ paginator.previous_page_path | absolute_url }}" class="pagination--pager" title="{{ page.previous.title }}">قبلی </a>
- {% else %}
- <a href="#" class="pagination--pager disabled"">قبلی </a>
- {% endif %}
- {% if paginator.next_page %}
- <a href="{{ paginator.next_page_path | absolute_url }}" class="pagination--pager" title="{{ page.next.title }}">بعدی</a>
- {% else %}
- <a href="#" class="pagination--pager disabled"">بعدی</a>
- {% endif %}
-</nav>
+{% 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>
\ No newline at end of file