diff --git a/samhuri.net/Sources/samhuri.net/Posts/PageRenderer+Posts.swift b/samhuri.net/Sources/samhuri.net/Posts/PageRenderer+Posts.swift index 9899bbc..0107e59 100644 --- a/samhuri.net/Sources/samhuri.net/Posts/PageRenderer+Posts.swift +++ b/samhuri.net/Sources/samhuri.net/Posts/PageRenderer+Posts.swift @@ -26,7 +26,7 @@ extension PageRenderer: PostsTemplateRenderer { func renderPost(_ post: Post, site: Site, assets: TemplateAssets) throws -> String { let context = SiteContext(site: site, subtitle: post.title, templateAssets: assets) - return render(.post(post), context: context) + return render(.post(post, articleClass: "container"), context: context) } func renderRecentPosts(_ posts: [Post], site: Site, assets: TemplateAssets) throws -> String { diff --git a/samhuri.net/Sources/samhuri.net/Posts/PostTemplate.swift b/samhuri.net/Sources/samhuri.net/Posts/PostTemplate.swift index f743cd6..cac06fe 100644 --- a/samhuri.net/Sources/samhuri.net/Posts/PostTemplate.swift +++ b/samhuri.net/Sources/samhuri.net/Posts/PostTemplate.swift @@ -9,9 +9,9 @@ import Foundation import Plot extension Node where Context == HTML.BodyContext { - static func post(_ post: Post) -> Self { + static func post(_ post: Post, articleClass: String = "") -> Self { .group([ - .article( + .article(.class(articleClass), .header( .h2(postTitleLink(post)), .time(.text(post.formattedDate)), diff --git a/samhuri.net/Sources/samhuri.net/Posts/RecentPostsTemplate.swift b/samhuri.net/Sources/samhuri.net/Posts/RecentPostsTemplate.swift index 98a4945..58e791d 100644 --- a/samhuri.net/Sources/samhuri.net/Posts/RecentPostsTemplate.swift +++ b/samhuri.net/Sources/samhuri.net/Posts/RecentPostsTemplate.swift @@ -11,7 +11,7 @@ import Plot extension Node where Context == HTML.BodyContext { static func recentPosts(_ posts: [Post]) -> Self { .div(.class("container"), - .group(posts.map(post)) + .group(posts.map { self.post($0) }) ) } }