From 5cb0ef6b87334b69dbbf2534acd34ce2f07164d4 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Thu, 3 Aug 2023 13:29:11 +0200 Subject: [PATCH] Prevent linking to unpublished content --- Sources/Generator/Generators/PageContentGenerator.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Generator/Generators/PageContentGenerator.swift b/Sources/Generator/Generators/PageContentGenerator.swift index 0765fa6..efcd7ae 100644 --- a/Sources/Generator/Generators/PageContentGenerator.swift +++ b/Sources/Generator/Generators/PageContentGenerator.swift @@ -361,6 +361,10 @@ struct PageContentGenerator { // Remove link since the page can't be found return "" } + guard linkedPage.state == .standard else { + // Prevent linking to unpublished content + return "" + } var content = [PageLinkTemplate.Key: String]() content[.title] = linkedPage.title(for: language)