-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paula Mendez
committed
Aug 19, 2022
1 parent
0ec0382
commit 8200985
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
layout: default | ||
--- | ||
<!-- Just some nice to have styles for the pager buttons --> | ||
<style> | ||
ul.pager { text-align: center; list-style: none; } | ||
ul.pager li {display: inline;border: 1px solid black; padding: 10px; margin: 5px;} | ||
</style> | ||
|
||
<div class="blog"> | ||
|
||
<h1 class="page-heading">Blog Posts</h1> | ||
|
||
{{ content }} | ||
|
||
<ul class="post-list"> | ||
<!-- | ||
Here is the main paginator logic called. | ||
All calls to site.posts should be replaced by paginator.posts | ||
--> | ||
{% for post in paginator.posts %} | ||
<li> | ||
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span> | ||
|
||
<h2> | ||
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a> | ||
</h2> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
<!-- | ||
Showing buttons to move to the next and to the previous list of posts (pager buttons). | ||
--> | ||
{% if paginator.total_pages > 1 %} | ||
<ul class="pager"> | ||
{% if paginator.previous_page %} | ||
<li class="previous"> | ||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">← Newer Posts</a> | ||
</li> | ||
{% endif %} | ||
{% if paginator.next_page %} | ||
<li class="next"> | ||
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Older Posts →</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
{% endif %} | ||
|
||
|
||
</div> |