Simplify images, tag overview

This commit is contained in:
Christoph Hagen
2025-01-04 08:44:26 +01:00
parent 4d4275e072
commit 22e7d9a05a
49 changed files with 603 additions and 509 deletions

View File

@ -56,7 +56,6 @@ final class Storage: ObservableObject {
// MARK: Pages
private func pageContentFileName(_ id: String, _ language: ContentLanguage) -> String {
"\(id)-\(language.rawValue).md"
}
@ -236,6 +235,23 @@ final class Storage: ObservableObject {
// MARK: Files
/**
The full path to a resource file in the content folder
- Parameter file: The filename of the file
- Note: Only for resource files, since path is relative to files folder
*/
func path(toFile file: String) -> URL? {
contentScope?.fullPath(to: filePath(file: file))
}
/**
The full file path to a file in the output folder
- Parameter relativePath: The path of the file relative to the output folder
*/
func outputPath(to relativePath: String) -> URL? {
outputScope?.fullPath(to: relativePath)
}
private func filePath(file fileId: String) -> String {
filesFolderName + "/" + fileId
}
@ -337,6 +353,7 @@ final class Storage: ObservableObject {
}
print("Found \(allImages.count) generated images")
let images = Set(allImages)
#warning("TODO: Fix counting generated images")
return imageSet.reduce(into: [:]) { result, imageName in
let prefix = imageName.fileNameWithoutExtension + "@"
let versions = images.filter { $0.hasPrefix(prefix) }