Add children to heading.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user