Customisable homepage limit posts

This commit is contained in:
Mahendrata Harpi
2020-08-29 11:24:21 +07:00
parent 14bcb9484e
commit 6fc041bfac
2 changed files with 6 additions and 3 deletions

View File

@@ -59,6 +59,9 @@ jekyll_compose:
tags: [] tags: []
description: description:
# Homepage limit posts
number_of_posts: 5
# Build settings # Build settings
# theme: klise # theme: klise
sass: sass:

View File

@@ -3,12 +3,12 @@ layout: default
home: true home: true
--- ---
<h4 class="posts-item-note">Recent Posts</h4> <h3 class="posts-item-note" aria-label="Recent Posts">Recent Posts</h3>
{% for post in site.posts %} {%- for post in site.posts limit: site.number_of_posts -%}
<article class="post-item"> <article class="post-item">
<span class="post-item-date">{{ post.date | date: "%b %d, %Y" }}</span> <span class="post-item-date">{{ post.date | date: "%b %d, %Y" }}</span>
<h4 class="post-item-title"> <h4 class="post-item-title">
<a href="{{ post.url }}">{{ post.title | escape }}</a> <a href="{{ post.url }}">{{ post.title | escape }}</a>
</h4> </h4>
</article> </article>
{% endfor %} {%- endfor -%}