Improve storage, paths

This commit is contained in:
Christoph Hagen
2024-12-16 21:01:38 +01:00
parent b22b76fd32
commit 849585acc7
19 changed files with 393 additions and 268 deletions

View File

@ -5,9 +5,6 @@ struct PathSettingsView: View {
@Environment(\.language)
private var language
@AppStorage("contentPath")
private var contentPath: String = ""
@EnvironmentObject
private var content: Content
@ -20,12 +17,12 @@ struct PathSettingsView: View {
FolderOnDiskPropertyView(
title: "Content Folder",
folder: $contentPath,
folder: $content.settings.paths.contentDirectoryPath,
footer: "The folder where the raw content of the website is stored") { url in
guard content.storage.save(folderUrl: url, in: .contentPath) else {
return
}
contentPath = url.path()
content.settings.paths.contentDirectoryPath = url.path()
}
FolderOnDiskPropertyView(