Skip to content

Commit

Permalink
only display 5 most recent posts
Browse files Browse the repository at this point in the history
  • Loading branch information
Paula Mendez committed Aug 30, 2022
1 parent 3538daf commit f612e85
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions _layouts/blog_ly.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
---
<!-- 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;}
ul.see_all { text-align: center; list-style: none; }
ul.see_all li {display: inline;border: 1px solid black; padding: 10px; margin: 5px;}
</style>

<div class="blog">

<h1 class="page-heading">Blog Posts</h1>
<h1 class="page-heading">Latest Posts</h1>

{{ content }}


<ul class="post-list" style="list-style: none;">
<!--
Here is the main paginator logic called.
All calls to site.posts should be replaced by paginator.posts
-->
{% for post in paginator.posts %}
<!-- {% for post in paginator.posts %} -->
<!-- {% endfor %} -->
{% for post in site.posts limit:4 %}
<li>
<h2>
<a id="post-title" class="post-link post-title" href="{{ post.url | relative_url }}">{{ post.title | escape }}
Expand All @@ -36,11 +39,13 @@ <h4 class="post-subtitle">{{ post.excerpt | strip_html | truncatewords: 15 }}</h
{% endfor %}
</ul>


<ul class="pager">
<a href="/archive">&larr; See all posts</a>
</ul>
<!--
Showing buttons to move to the next and to the previous list of posts (pager buttons).
-->
{% if paginator.total_pages > 1 %}
<!-- {% if paginator.total_pages > 1 %}
<ul class="pager">
{% if paginator.previous_page %}
<li class="previous">
Expand All @@ -53,7 +58,7 @@ <h4 class="post-subtitle">{{ post.excerpt | strip_html | truncatewords: 15 }}</h
</li>
{% endif %}
</ul>
{% endif %}
{% endif %} -->


</div>

0 comments on commit f612e85

Please sign in to comment.