Import old content, load from disk

This commit is contained in:
Christoph Hagen
2024-11-18 20:19:20 +01:00
parent 0989f06d87
commit 943d8d962b
24 changed files with 1326 additions and 210 deletions

View File

@@ -0,0 +1,48 @@
import Foundation
final class LocalizedTag: ObservableObject {
@Published
var urlComponent: String
/// A custom name, different from the tag id
@Published
var name: String
@Published
var subtitle: String?
@Published
var description: String?
/// The image id of the thumbnail
@Published
var thumbnail: String?
/// The original url in the previous site layout
let originalUrl: String?
init(urlComponent: String,
name: String,
subtitle: String? = nil,
description: String? = nil,
thumbnail: String? = nil,
originalUrl: String? = nil) {
self.urlComponent = urlComponent
self.name = name
self.subtitle = subtitle
self.description = description
self.thumbnail = thumbnail
self.originalUrl = originalUrl
}
}
extension LocalizedTag {
func data() -> FeedEntryData.Tag {
.init(
name: name,
url: "tags/\(urlComponent).html"
)
}
}