37 lines
828 B
Swift
37 lines
828 B
Swift
|
|
struct FeedGeneratorSource: PostListPageGeneratorSource {
|
|
|
|
let language: ContentLanguage
|
|
|
|
let content: Content
|
|
|
|
let results: PageGenerationResults
|
|
|
|
var showTitle: Bool {
|
|
false
|
|
}
|
|
|
|
var postsPerPage: Int {
|
|
content.settings.posts.postsPerPage
|
|
}
|
|
|
|
var pageTitle: String {
|
|
content.settings.posts.localized(in: language).title
|
|
}
|
|
|
|
var pageDescription: String {
|
|
content.settings.posts.localized(in: language).description
|
|
}
|
|
|
|
/**
|
|
The url to the page, including a leading slash
|
|
*/
|
|
func pageUrlPrefix(for language: ContentLanguage) -> String {
|
|
let prefix = content.settings.posts.localized(in: language).feedUrlPrefix
|
|
if prefix.hasPrefix( "/" ) {
|
|
return prefix
|
|
}
|
|
return "/" + prefix
|
|
}
|
|
}
|