Fix links and images in related content

This commit is contained in:
Christoph Hagen 2022-11-27 22:06:18 +01:00
parent 112bbe252c
commit 58f7642ca5
2 changed files with 1 additions and 4 deletions

View File

@ -253,7 +253,6 @@ struct PageContentGenerator {
return ""
}
var content = [PageLinkTemplate.Key: String]()
content[.url] = page.relativePathToOtherSiteElement(file: linkedPage.fullPageUrl(for: language))
content[.title] = linkedPage.title(for: language)
@ -267,13 +266,12 @@ struct PageContentGenerator {
content[.url] = "href=\"\(relativePageUrl)\""
}
content[.image] = relativeImageUrl
content[.image] = relativeImageUrl.dropAfterLast(".")
if let suffix = metadata.thumbnailSuffix {
content[.title] = factory.html.make(title: metadata.title, suffix: suffix)
} else {
content[.title] = metadata.title
}
content[.image2x] = relativeImageUrl.insert("@2x", beforeLast: ".")
let path = linkedPage.makePath(language: language, from: siteRoot)
content[.path] = factory.pageLink.makePath(components: path)

View File

@ -5,7 +5,6 @@ struct PageLinkTemplate: Template {
enum Key: String, CaseIterable {
case url = "URL"
case image = "IMAGE"
case image2x = "IMAGE_2X"
case title = "TITLE"
case path = "PATH"
case description = "DESCRIPTION"