|
@@ -12,10 +12,13 @@ pub fn render_post(layout: &str, post_template: &str, post: &Post, config: &Conf
|
12
|
12
|
)
|
13
|
13
|
.replace(
|
14
|
14
|
"{{ contents }}",
|
15
|
|
- &post_template.replace("{{ title }}", &post.title).replace(
|
16
|
|
- "{{ body }}",
|
17
|
|
- &markdown_to_html(&post.body, &ComrakOptions::default()),
|
18
|
|
- ),
|
|
15
|
+ &post_template
|
|
16
|
+ .replace("{{ title }}", &post.title)
|
|
17
|
+ .replace(
|
|
18
|
+ "{{ body }}",
|
|
19
|
+ &markdown_to_html(&post.body, &ComrakOptions::default()),
|
|
20
|
+ )
|
|
21
|
+ .replace("{{ date }}", &post.date.format("%Y-%m-%d").to_string()),
|
19
|
22
|
)
|
20
|
23
|
}
|
21
|
24
|
|
|
@@ -53,6 +56,7 @@ pub fn render_post_listing(
|
53
|
56
|
post_item_template
|
54
|
57
|
.replace("{{ slug }}", &post.slug)
|
55
|
58
|
.replace("{{ title }}", &post.title)
|
|
59
|
+ .replace("{{ date }}", &post.date.format("%Y-%m-%d").to_string())
|
56
|
60
|
})
|
57
|
61
|
.collect::<Vec<String>>()
|
58
|
62
|
.join("\n"),
|