X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/2998247083406f914b3647cedd19abf5507bf2c6..edcd0e51b3e0a6d52a560f293b7e6a08999cfd0c:/src/command/generate.rs?ds=inline 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(()) }