website/blog.html

37 lines
1.1 KiB
HTML
Raw Normal View History

2019-09-06 15:06:45 +00:00
---
title: Blog
2021-07-09 15:18:19 +00:00
permalink: /blog/
2019-09-06 15:06:45 +00:00
pagination:
enabled: true
---
2021-08-15 06:41:43 +00:00
<!-- posts -->
2019-09-06 15:06:45 +00:00
{% for post in paginator.posts %}
2021-08-15 06:41:43 +00:00
<h2><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h2>
<p class="post-metadata">Published on {{ post.date | date: "%b %-d, %Y" }}</p>
2019-09-06 15:06:45 +00:00
{{ post.content }}
{% endfor %}
2021-08-15 06:41:43 +00:00
<!-- pagination -->
2019-09-06 15:06:45 +00:00
{% if paginator.total_pages > 1 %}
2021-08-15 06:41:43 +00:00
<ul class="pagination">
2019-09-06 15:06:45 +00:00
{% if paginator.previous_page %}
2021-08-15 06:41:43 +00:00
<li><a href="{{ paginator.previous_page_path | relative_url }}">&laquo; Prev</a>
2019-09-06 15:06:45 +00:00
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
2021-08-15 06:41:43 +00:00
<li>{{ page }}</li>
2019-09-06 15:06:45 +00:00
{% elsif page == 1 %}
2021-08-15 06:41:43 +00:00
<li><a href="{{ paginator.previous_page_path | relative_url }}">{{ page }}</a></li>
2019-09-06 15:06:45 +00:00
{% else %}
2021-08-15 06:41:43 +00:00
<li><a href="{{ site.paginate_path | relative_url | replace: ':num', page }}">{{ page }}</a></li>
2019-09-06 15:06:45 +00:00
{% endif %}
{% endfor %}
{% if paginator.next_page %}
2021-08-15 06:41:43 +00:00
<li><a href="{{ paginator.next_page_path | relative_url }}">Next &raquo;</a></li>
2019-09-06 15:06:45 +00:00
{% endif %}
2021-08-15 06:41:43 +00:00
</ul>
2019-09-06 15:06:45 +00:00
{% endif %}