Add error message when no posts are found

This commit is contained in:
Raven Scott
2024-09-26 02:00:48 -04:00
parent 9ec9374ea2
commit ec891ab070
2 changed files with 15 additions and 3 deletions

View File

@ -49,7 +49,11 @@
<div class="container">
<!-- Blog post list -->
<h2><%= searchQuery ? `Search results for "${searchQuery}"` : 'Recent Posts' %></h2>
<% if (noResults) { %>
<p><CENTER>Sorry, no blog posts found matching "<%= searchQuery %>"</CENTER></p>
<% } else { %>
<h2><%= searchQuery ? 'Search results for "' + searchQuery + '"' : 'Recent Posts' %></h2>
<% } %>
<ul class="list-group list-group-flush">
<% blogPosts.forEach(post => { %>
<li class="list-group-item d-flex justify-content-between align-items-center py-4">