From 666b926d5314fffc3d0f2e1bddddcae91a25ed8f Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 4 Dec 2019 17:48:18 -0800 Subject: [PATCH] Fix rendering posts by month --- SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift b/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift index 7a65b35..37cec80 100644 --- a/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift +++ b/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift @@ -94,7 +94,7 @@ final class PostsPlugin: Plugin { let monthDir = yearDir.appendingPathComponent(month.padded) try fileManager.createDirectory(at: monthDir, withIntermediateDirectories: true, attributes: nil) - let context: [String: Any] = ["path": postsPath, "month": month, "posts": renderedPosts] + let context: [String: Any] = ["posts": renderedPosts.map { $0.dictionary }] let monthHTML = try templateRenderer.renderTemplate(name: "posts-month", context: context) let monthURL = monthDir.appendingPathComponent("index.html") try monthHTML.write(to: monthURL, atomically: true, encoding: .utf8)