Don't link draft pages

This commit is contained in:
Christoph Hagen 2025-01-27 07:56:50 +01:00
parent 82c40cc080
commit e02bfd17d2

View File

@ -54,8 +54,9 @@ final class PostListPageGenerator {
private func makePostData(post: Post) -> FeedEntryData {
let localized: LocalizedPost = post.localized(in: language)
let linkUrl = post.linkedPage.map {
FeedEntryData.Link(
let linkUrl: FeedEntryData.Link? = post.linkedPage.map {
guard !$0.isDraft else { return nil }
return .init(
url: $0.absoluteUrl(in: language),
text: localized.pageLinkText ?? post.content.settings.posts.localized(in: language).defaultPageLinkText)
}