CHGenerator/WebsiteGenerator/Content/LinkPreviewMetadataProvider.swift
Christoph Hagen 14b935249f First version
2022-08-16 10:39:05 +02:00

24 lines
443 B
Swift

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
}
}