Add draft indicator, filter drafts, show issue count
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user