Skip to content

Commit

Permalink
Merge pull request #395 from Smileslime47/patch-1
Browse files Browse the repository at this point in the history
feat:sort archive-list by post's title when the date is same
  • Loading branch information
EvanNotFound authored Jul 27, 2024
2 parents 7f2b16d + b69d140 commit e4dcf7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layout/_widgets/archive-list.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<% let previousDate = null; %>
<ul class="article-list pl-0 md:pl-8 text-lg leading-[1.5]">
<% postYear.postList.forEach(post => { %>
<% postYear.postList.sort((a,b) => (a.date > b.date ? -1 : (a.date < b.date ? 1 : a.title.localeCompare(b.title)))).forEach(post => { %>
<% const currentDate = date(post.date, 'MM-DD'); %>
<% if (previousDate !== currentDate) { %>
<% if (previousDate) { %>
Expand Down

0 comments on commit e4dcf7e

Please sign in to comment.