X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/2998247083406f914b3647cedd19abf5507bf2c6..c667f2401b3ada832f8456d1661ea3fba667fc91:/src/command/generate.rs?ds=sidebyside diff --git a/src/command/generate.rs b/src/command/generate.rs index c8c5673..cc9e401 100644 --- a/src/command/generate.rs +++ b/src/command/generate.rs @@ -5,6 +5,7 @@ use crate::configuration::Configuration; use crate::constants::METADATA_FILENAME; use crate::gemini_parser::parse; use crate::generator::generate; +use crate::archiver::archive; use crate::metadata::Metadata; use crate::post::Post; @@ -18,7 +19,7 @@ impl Generate { fn read_posts(&self, posts_directory: &PathBuf, max_posts: u8) -> Vec { let mut posts = Vec::new(); - for i in 0..max_posts - 1 { + for i in 0..max_posts { let post_directory = posts_directory.join(i.to_string()); match self.read_post(&post_directory, i) { Some(post) => posts.push(post), @@ -82,6 +83,11 @@ impl super::Command for Generate { let _ = remove_dir_all(&configuration.archive_output_directory); create_dir_all(&configuration.archive_output_directory)?; + archive( + &configuration.archive_directory, + &configuration.templates_directory, + &configuration.archive_output_directory + )?; return Ok(()) }