Import old content, load from disk

This commit is contained in:
Christoph Hagen
2024-11-18 20:19:20 +01:00
parent 0989f06d87
commit 943d8d962b
24 changed files with 1326 additions and 210 deletions

View File

@@ -55,17 +55,15 @@ struct PostList: View {
}
private func addNewPost() {
let largestId = posts.map { $0.id }.max() ?? 0
let post = Post(
id: largestId + 1,
id: "new",
isDraft: true,
createdDate: .now,
startDate: .now,
endDate: nil,
title: .init(en: "Title", de: "Titel"),
text: .init(en: "Text", de: "Text"),
tags: [],
images: [])
german: .init(title: "Titel", content: "Text"),
english: .init(title: "Title", content: "Text"))
posts.insert(post, at: 0)
}
}