
struct TagPageGeneratorSource: PostListPageGeneratorSource {

    let language: ContentLanguage

    let content: Content

    let results: PageGenerationResults

    let tag: Tag

    var showTitle: Bool {
        true
    }

    var postsPerPage: Int {
        content.settings.posts.postsPerPage
    }

    var pageTitle: String {
        tag.localized(in: language).name
    }

    var pageDescription: String {
        tag.localized(in: language).linkPreviewDescription ?? ""
    }

    func pageUrlPrefix(for language: ContentLanguage) -> String {
        tag.absoluteUrl(in: language)
    }
}
