]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/generate.rs
Get rid of signing code
[rbdr/blog] / src / command / generate.rs
index c8c567392ea63ef1f7ff2ab4b12bc10337b759a0..cc9e4015dbadda0dd1d865958e29f81fa7ce7620 100644 (file)
@@ -5,6 +5,7 @@ use crate::configuration::Configuration;
 use crate::constants::METADATA_FILENAME;
 use crate::gemini_parser::parse;
 use crate::generator::generate;
 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;
 
 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<Post> {
         let mut posts = Vec::new();
 
     fn read_posts(&self, posts_directory: &PathBuf, max_posts: u8) -> Vec<Post> {
         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),
             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)?;
 
         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(())
     }
 
         return Ok(())
     }