Skip to content

Commit 556dfb6

Browse files
committed
feat: display message if no posts are available
1 parent 9cc8b89 commit 556dfb6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

_layouts/default.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ <h1>Michael Avagianos</h1>
2424
<div class="blog-posts">
2525
<h2>Blog Posts</h2>
2626
<ul>
27-
{%- for post in site.posts limit: 5 -%}
27+
{%- if site.posts.size == 0 -%}
28+
<em>No posts yet :c</em>
29+
{%- else-%} {%- for post in site.posts limit: 5 -%}
2830
<li>
2931
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
3032
</li>
31-
{%- endfor -%}
33+
{%- endfor -%} {%- endif -%}
3234
</ul>
3335
</div>
3436
</aside>

0 commit comments

Comments
 (0)