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;
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 _ = 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(())
}