Add button to delete page
This commit is contained in:
@ -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 }
|
||||
}
|
||||
|
Reference in New Issue
Block a user