diff --git a/WebsiteGenerator/Generators/PageGenerator.swift b/WebsiteGenerator/Generators/PageGenerator.swift index 0a3811a..34aa0ec 100644 --- a/WebsiteGenerator/Generators/PageGenerator.swift +++ b/WebsiteGenerator/Generators/PageGenerator.swift @@ -36,7 +36,7 @@ struct PageGenerator { if !page.useCustomHeader { content[.header] = makeHeader(page: page, metadata: metadata, language: language) } - content[.content] = pageContent?.content ?? factory.placeholder + content[.content] = pageContent?.content ?? factory.makePlaceholder(metadata: metadata) content[.previousPageLinkText] = previousPage.unwrapped { factory.factory.html.makePrevText($0.text) } content[.previousPageUrl] = previousPage?.link content[.nextPageLinkText] = nextPage.unwrapped { factory.factory.html.makeNextText($0.text) } diff --git a/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift b/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift index 40d1835..9ead90d 100644 --- a/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift +++ b/WebsiteGenerator/Templates/Filled/LocalizedSiteTemplate.swift @@ -19,8 +19,6 @@ struct LocalizedSiteTemplate { let overviewSection: OverviewSectionGenerator - let placeholder: String - private let fullDateFormatter: DateFormatter private let month: DateFormatter @@ -57,8 +55,6 @@ struct LocalizedSiteTemplate { df3.locale = Locale(identifier: language) self.day = df3 - let metadata = site.localized(for: language) - let sections = site.sortedItems.map { PrefilledTopBarTemplate.SectionInfo( name: $0.title(for: language), @@ -74,14 +70,16 @@ struct LocalizedSiteTemplate { factory: factory) self.overviewSection = OverviewSectionGenerator( factory: factory) - - self.placeholder = factory.placeholder.generate([ - .title: metadata.placeholderTitle, - .text: metadata.placeholderText]) } // MARK: Content + func makePlaceholder(metadata: Element.LocalizedMetadata) -> String { + factory.placeholder.generate([ + .title: metadata.placeholderTitle, + .text: metadata.placeholderText]) + } + func makeBackLink(text: String, language: String) -> String { let content: [BackNavigationTemplate.Key : String] = [ .text: text,