Determine elements for news section
This commit is contained in:
@ -15,6 +15,21 @@ struct OverviewSectionGenerator {
|
||||
}
|
||||
|
||||
func generate(sections: [Element], in parent: Element, language: String, sectionItemCount: Int) -> String {
|
||||
let content = sectionsContent(sections, in: parent, language: language, sectionItemCount: sectionItemCount)
|
||||
if parent.showMostRecentSection {
|
||||
let news = newsSectionContent(for: parent, language: language, sectionItemCount: sectionItemCount)
|
||||
return news + "\n" + content
|
||||
} else {
|
||||
return content
|
||||
}
|
||||
}
|
||||
|
||||
private func newsSectionContent(for element: Element, language: String, sectionItemCount: Int) -> String {
|
||||
let shownElements = element.mostRecentElements(sectionItemCount)
|
||||
return ""
|
||||
}
|
||||
|
||||
private func sectionsContent(_ sections: [Element], in parent: Element, language: String, sectionItemCount: Int) -> String {
|
||||
sections.map { section in
|
||||
let metadata = section.localized(for: language)
|
||||
let fullUrl = section.fullPageUrl(for: language)
|
||||
|
Reference in New Issue
Block a user