CHGenerator/WebsiteGenerator/Content/LinkPreviewMetadataProvider.swift

24 lines
443 B
Swift
Raw Normal View History

2022-08-16 10:39:05 +02:00
import Foundation
protocol LinkPreviewMetadataProvider {
var linkPreview: LinkPreviewMetadata? { get }
var title: String { get }
var subtitle: String? { get }
var description: String { get }
}
extension LinkPreviewMetadataProvider {
var linkPreviewTitle: String {
linkPreview?.title ?? title
}
var linkPreviewDescription: String {
linkPreview?.description ?? subtitle ?? description
}
}