Consistent sorting of output

This commit is contained in:
Christoph Hagen
2025-01-27 07:56:36 +01:00
parent 09b1f48aea
commit 82c40cc080
6 changed files with 23 additions and 6 deletions

View File

@ -32,7 +32,7 @@ final class PostListPageGenerator {
// Sort by newest first, filter drafts
let posts = posts
.filter { !$0.isDraft }
.sorted(ascending: false) { $0.startDate }
.sorted { $0.startDate > $1.startDate && $0.id < $1.id }
let totalCount = posts.count
guard totalCount > 0 else {