Rework path storage, add start screen

This commit is contained in:
Christoph Hagen
2024-12-17 23:05:45 +01:00
parent 849585acc7
commit 9a53e020a7
21 changed files with 408 additions and 229 deletions

View File

@ -184,7 +184,7 @@ struct PageIssueView: View {
isExternallyStored: true,
en: "",
de: "")
content.files.append(file)
content.add(file)
retryPageCheck()
}

View File

@ -59,11 +59,10 @@ struct GenerationContentView: View {
}
private func generateFeed() {
guard content.settings.paths.outputDirectoryPath != "" else {
guard let url = content.storage.outputPath else {
print("Invalid output path")
return
}
let url = content.settings.outputDirectory
guard FileManager.default.fileExists(atPath: url.path) else {
print("Missing output folder")

View File

@ -17,22 +17,19 @@ struct PathSettingsView: View {
FolderOnDiskPropertyView(
title: "Content Folder",
folder: $content.settings.paths.contentDirectoryPath,
folder: $content.storage.contentPath,
footer: "The folder where the raw content of the website is stored") { url in
guard content.storage.save(folderUrl: url, in: .contentPath) else {
guard content.storage.save(contentPath: url) else {
return
}
content.settings.paths.contentDirectoryPath = url.path()
#warning("Reload database")
}
FolderOnDiskPropertyView(
title: "Output Folder",
folder: $content.settings.paths.outputDirectoryPath,
folder: $content.storage.outputPath,
footer: "The folder where the generated website is stored") { url in
guard content.storage.save(folderUrl: url, in: .outputPath) else {
return
}
content.settings.paths.outputDirectoryPath = url.path()
content.storage.save(outputPath: url)
}
StringPropertyView(