Generate
}
- fn read_posts(&self, posts_directory: &Path, max_posts: u8) -> Vec<Post> {
+ fn read_posts(posts_directory: &Path, max_posts: u8) -> Vec<Post> {
let mut posts = Vec::new();
for i in 0..max_posts {
let post_path = posts_directory.join(i.to_string());
- match self.read_post(&post_path, i) {
+ match Generate::read_post(&post_path, i) {
Some(post) => posts.push(post),
None => continue,
}
None
}
- fn read_post(&self, post_directory: &Path, index: u8) -> Option<Post> {
+ fn read_post(post_directory: &Path, index: u8) -> Option<Post> {
let metadata_path = post_directory.join(METADATA_FILENAME);
let metadata = Metadata::read_or_create(&metadata_path);
let raw = Generate::find_blog_content(post_directory)?;
let _ = remove_dir_all(&configuration.blog_output_directory);
create_dir_all(&configuration.blog_output_directory)?;
- let posts = self.read_posts(&configuration.posts_directory, configuration.max_posts);
+ let posts = Generate::read_posts(&configuration.posts_directory, configuration.max_posts);
generate(
&configuration.static_directory,
&configuration.templates_directory,