Allow absolute urls for link preview thumbnails
This commit is contained in:
parent
9408b91741
commit
9a40da63d3
@ -106,8 +106,12 @@ final class ValidationLog {
|
||||
|
||||
func linkPreviewThumbnail(customFile: String?, for language: String, in folder: URL, source: String) -> String? {
|
||||
if let customFile = customFile {
|
||||
#warning("Allow absolute urls for link preview thumbnails")
|
||||
let customFileUrl = folder.appendingPathComponent(customFile)
|
||||
let customFileUrl: URL
|
||||
if customFile.starts(with: "/") {
|
||||
customFileUrl = URL(fileURLWithPath: customFile)
|
||||
} else {
|
||||
customFileUrl = folder.appendingPathComponent(customFile)
|
||||
}
|
||||
guard customFileUrl.exists else {
|
||||
missing(customFile, requiredBy: "property 'linkPreviewImage' in metadata of \(source)")
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user