Add button to delete page

This commit is contained in:
Christoph Hagen
2025-05-04 11:48:31 +02:00
parent 329519e15b
commit cb041eb6ed
4 changed files with 55 additions and 0 deletions

View File

@ -135,6 +135,18 @@ final class Content: ObservableObject {
posts.remove(post)
}
func remove(_ page: Page) {
pages.remove(page)
for post in posts {
if post.linkedPage == page {
post.linkedPage = nil
}
}
// TODO: Check for page links and other references in content
}
// MARK: Loading
func file(withOutputPath: String) -> FileResource? {
files.first { $0.absoluteUrl == withOutputPath }
}