2025-02-24 19:12:15 +01:00

41 lines
1.3 KiB
Swift

import Foundation
extension Page {
enum Mock {
static func mockData(content: Content) -> [Page] {
[
Page(
content: content,
id: "my-id",
externalLink: nil,
isDraft: true,
createdDate: Date(),
hideDate: false,
startDate: Date().addingTimeInterval(-86400),
endDate: nil,
german: LocalizedPage(
content: content,
urlString: "mein-projekt",
title: "Mein Erstes Projekt",
lastModified: nil,
originalUrl: "projects/electronics/my-first-project/de.html"),
english: LocalizedPage(
content: content,
urlString: "my-project",
title: "My First Project",
lastModified: nil,
originalUrl: "projects/electronics/my-first-project/en.html"),
tags: [
content.tags.first(where: { $0.id == "electronics" })!
])
]
}
static var empty: Page {
Content.mock.pages.first(where: { $0.id == "my-id" })!
}
}
}