Add draft indicator, filter drafts, show issue count

This commit is contained in:
Christoph Hagen
2025-01-07 14:03:07 +01:00
parent 9d95e7d210
commit 508483071a
10 changed files with 124 additions and 32 deletions

View File

@ -21,8 +21,11 @@ final class PostListPageGenerator {
}
func createPages(for posts: [Post]) {
// Sort by newest first
let posts = posts.sorted(ascending: false) { $0.startDate }
// Sort by newest first, filter drafts
let posts = posts
.filter { !$0.isDraft }
.sorted(ascending: false) { $0.startDate }
let totalCount = posts.count
guard totalCount > 0 else {
// Create one empty page