Prevent linking to unpublished content

This commit is contained in:
Christoph Hagen 2023-08-03 13:29:11 +02:00
parent 2608e870cc
commit 5cb0ef6b87

View File

@ -361,6 +361,10 @@ struct PageContentGenerator {
// Remove link since the page can't be found // Remove link since the page can't be found
return "" return ""
} }
guard linkedPage.state == .standard else {
// Prevent linking to unpublished content
return ""
}
var content = [PageLinkTemplate.Key: String]() var content = [PageLinkTemplate.Key: String]()
content[.title] = linkedPage.title(for: language) content[.title] = linkedPage.title(for: language)