From 42ae7574145805a503ee57e12b9d0109651f5f36 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Mon, 29 Aug 2022 13:35:40 +0200 Subject: [PATCH] Hide back navigation for empty texts --- WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift b/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift index 7478363..40d1835 100644 --- a/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift +++ b/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift @@ -139,7 +139,9 @@ struct LocalizedSiteTemplate { let backText = page.backLinkText(for: language) var content = [HeaderKey : String]() - content[.backLink] = makeBackLink(text: backText, language: language) + if let backText = backText.nonEmpty { + content[.backLink] = makeBackLink(text: backText, language: language) + } if let suffix = metadata.titleSuffix { content[.title] = factory.html.make(title: metadata.title, suffix: suffix) } else {