mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
Fix post template
This commit is contained in:
parent
1e8330dda4
commit
2d8fc2cfa3
3 changed files with 4 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)),
|
||||
|
|
|
|||
|
|
@ -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) })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue