Only print the contexts.
This allows us to pipe the output to jq to see the context easier. We can see the rendered output in the files written to disk.
This commit is contained in:
parent
2b7a19a1d4
commit
31a3efe417
@ -3,9 +3,9 @@ use std::path::Path;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::error::CustomError;
|
|
||||||
use crate::context::GlobalSettings;
|
use crate::context::GlobalSettings;
|
||||||
use crate::context::RenderBlogPostPage;
|
use crate::context::RenderBlogPostPage;
|
||||||
|
use crate::error::CustomError;
|
||||||
|
|
||||||
use super::BlogPost;
|
use super::BlogPost;
|
||||||
use super::BlogPostPage;
|
use super::BlogPostPage;
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
|
|
||||||
|
use super::Object;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) struct Heading {}
|
pub(crate) struct Heading {
|
||||||
|
title: Vec<Object>,
|
||||||
|
}
|
||||||
|
|
||||||
impl Heading {
|
impl Heading {
|
||||||
pub(crate) fn new(heading: &organic::types::Heading<'_>) -> Result<Heading, CustomError> {
|
pub(crate) fn new(heading: &organic::types::Heading<'_>) -> Result<Heading, CustomError> {
|
||||||
todo!()
|
Ok(Heading { title: Vec::new() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,6 @@ pub(crate) struct Section {}
|
|||||||
|
|
||||||
impl Section {
|
impl Section {
|
||||||
pub(crate) fn new(section: &organic::types::Section<'_>) -> Result<Section, CustomError> {
|
pub(crate) fn new(section: &organic::types::Section<'_>) -> Result<Section, CustomError> {
|
||||||
todo!()
|
Ok(Section {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,6 @@ impl SiteRenderer {
|
|||||||
blog_post_page,
|
blog_post_page,
|
||||||
)?;
|
)?;
|
||||||
let rendered_output = renderer_integration.render(render_context)?;
|
let rendered_output = renderer_integration.render(render_context)?;
|
||||||
println!("Rendered: {}", rendered_output);
|
|
||||||
let parent_directory = output_path
|
let parent_directory = output_path
|
||||||
.parent()
|
.parent()
|
||||||
.ok_or("Output file should have a containing directory.")?;
|
.ok_or("Output file should have a containing directory.")?;
|
||||||
|
@ -18,6 +18,6 @@ impl RenderSection {
|
|||||||
output_file: F,
|
output_file: F,
|
||||||
section: &Section,
|
section: &Section,
|
||||||
) -> Result<RenderSection, CustomError> {
|
) -> Result<RenderSection, CustomError> {
|
||||||
todo!()
|
Ok(RenderSection {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ impl<'a> RendererIntegration<'a> for DusterRenderer<'a> {
|
|||||||
}
|
}
|
||||||
// TODO: This is horribly inefficient. I am converting from a serialize type to json and back again so I can use the existing implementation of IntoContextElement. Honestly, I probably need to rework a lot of duster now that I've improved in rust over the years.
|
// TODO: This is horribly inefficient. I am converting from a serialize type to json and back again so I can use the existing implementation of IntoContextElement. Honestly, I probably need to rework a lot of duster now that I've improved in rust over the years.
|
||||||
let json_context = serde_json::to_string(&context)?;
|
let json_context = serde_json::to_string(&context)?;
|
||||||
println!("Context: {}", json_context);
|
println!("{}", json_context);
|
||||||
let parsed_context: serde_json::Value = serde_json::from_str(json_context.as_str())?;
|
let parsed_context: serde_json::Value = serde_json::from_str(json_context.as_str())?;
|
||||||
let rendered_output = dust_renderer.render("main", Some(&parsed_context))?;
|
let rendered_output = dust_renderer.render("main", Some(&parsed_context))?;
|
||||||
Ok(rendered_output)
|
Ok(rendered_output)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user