Skip to content

Commit 6caa522

Browse files
committed
Fix blog folder name generating
1 parent e6c5689 commit 6caa522

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ impl Generator {
137137
fn render_post(&self, blog: &Blog, post: &Post) -> Result<(), Box<dyn Error>> {
138138
let path = blog
139139
.prefix()
140-
.join(&post.year.to_string())
141-
.join(&post.month.to_string())
142-
.join(&post.day.to_string());
140+
.join(format!("{:04}", &post.year))
141+
.join(format!("{:02}", &post.month))
142+
.join(format!("{:02}", &post.day));
143143
fs::create_dir_all(self.out_directory.join(&path))?;
144144

145145
// then, we render the page in that path

0 commit comments

Comments
 (0)