Rename the output root directory in the render context.

This commit is contained in:
Tom Alexander 2023-12-19 18:03:59 -05:00
parent 2e1c979127
commit 1581e5c401
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 11 additions and 11 deletions

View File

@ -57,14 +57,14 @@ render!(
// )?, // )?,
get_web_path( get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
"stylesheet/main.css", "stylesheet/main.css",
)?, )?,
]; ];
let js_files = vec![get_web_path( let js_files = vec![get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
"blog_post.js", "blog_post.js",
)?]; )?];
@ -73,18 +73,18 @@ render!(
render_context.config.get_site_title().map(str::to_string), render_context.config.get_site_title().map(str::to_string),
Some(get_web_path( Some(get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
"", "",
)?), )?),
); );
let link_to_blog_post = get_web_path( let link_to_blog_post = get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
render_context render_context
.output_file .output_file
.strip_prefix(render_context.output_directory)?, .strip_prefix(render_context.output_root_directory)?,
)?; )?;
let children = { let children = {

View File

@ -57,14 +57,14 @@ render!(
// )?, // )?,
get_web_path( get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
"stylesheet/main.css", "stylesheet/main.css",
)?, )?,
]; ];
let js_files = vec![get_web_path( let js_files = vec![get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
"blog_post.js", "blog_post.js",
)?]; )?];
@ -77,7 +77,7 @@ render!(
render_context.config.get_site_title().map(str::to_string), render_context.config.get_site_title().map(str::to_string),
Some(get_web_path( Some(get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
"", "",
)?), )?),
@ -151,7 +151,7 @@ render!(
}; };
let link_to_blog_post = get_web_path( let link_to_blog_post = get_web_path(
render_context.config, render_context.config,
render_context.output_directory, render_context.output_root_directory,
render_context.output_file, render_context.output_file,
render_context render_context
.config .config

View File

@ -8,7 +8,7 @@ use crate::error::CustomError;
pub(crate) struct RenderContext<'intermediate> { pub(crate) struct RenderContext<'intermediate> {
pub(crate) config: &'intermediate Config, pub(crate) config: &'intermediate Config,
// TODO: Perhaps rename to output_root_directory. // TODO: Perhaps rename to output_root_directory.
pub(crate) output_directory: &'intermediate Path, pub(crate) output_root_directory: &'intermediate Path,
pub(crate) output_file: &'intermediate Path, pub(crate) output_file: &'intermediate Path,
/// An optional string that gets added to IDs in HTML. /// An optional string that gets added to IDs in HTML.
@ -28,7 +28,7 @@ impl<'intermediate> RenderContext<'intermediate> {
) -> Result<RenderContext<'intermediate>, CustomError> { ) -> Result<RenderContext<'intermediate>, CustomError> {
Ok(RenderContext { Ok(RenderContext {
config, config,
output_directory, output_root_directory: output_directory,
output_file, output_file,
id_addition, id_addition,
}) })