Generate open graph meta tags

This commit is contained in:
Christoph Hagen
2025-01-15 22:04:48 +01:00
parent 4b448f3415
commit f6b868502d
21 changed files with 324 additions and 109 deletions

View File

@ -246,6 +246,20 @@ final class FileResource: Item, LocalizedItem {
.init(image: self, type: type, maximumWidth: width, maximumHeight: height)
}
func linkPreviewImage(results: PageGenerationResults) -> String {
let type: FileType
switch self.type {
case .jpg, .png, .gif: type = self.type
default: type = .jpg
}
let version = imageVersion(
width: content.settings.general.linkPreviewImageWidth,
height: content.settings.general.linkPreviewImageHeight,
type: type)
results.require(image: version)
return content.settings.general.url + version.outputPath
}
// MARK: Paths
func removeFileFromOutputFolder() {