Add children to heading.

This commit is contained in:
Tom Alexander
2023-10-27 18:59:40 -04:00
parent bd982fb62d
commit c279bad13a
62 changed files with 406 additions and 203 deletions

View File

@@ -6,13 +6,10 @@ use crate::config::Config;
use crate::context::GlobalSettings;
use crate::context::RenderBlogPostPage;
use crate::context::RenderDocumentElement;
use crate::context::RenderHeading;
use crate::context::RenderSection;
use crate::error::CustomError;
use super::BlogPost;
use super::BlogPostPage;
use super::IDocumentElement;
pub(crate) fn convert_blog_post_page_to_render_context<D: AsRef<Path>, F: AsRef<Path>>(
config: &Config,
@@ -47,24 +44,12 @@ pub(crate) fn convert_blog_post_page_to_render_context<D: AsRef<Path>, F: AsRef<
let mut children = Vec::new();
for child in page.children.iter() {
match child {
IDocumentElement::Heading(heading) => {
children.push(RenderDocumentElement::Heading(RenderHeading::new(
config,
output_directory,
output_file,
heading,
)?));
}
IDocumentElement::Section(section) => {
children.push(RenderDocumentElement::Section(RenderSection::new(
config,
output_directory,
output_file,
section,
)?));
}
}
children.push(RenderDocumentElement::new(
config,
output_directory,
output_file,
child,
)?);
}
children