From 1581e5c4011d336906a9d9d9605b3c284db6f0e2 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 19 Dec 2023 18:03:59 -0500 Subject: [PATCH] Rename the output root directory in the render context. --- src/context/blog_post_page.rs | 10 +++++----- src/context/blog_stream.rs | 8 ++++---- src/context/render_context.rs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/context/blog_post_page.rs b/src/context/blog_post_page.rs index 20ae9d5..1bbebdc 100644 --- a/src/context/blog_post_page.rs +++ b/src/context/blog_post_page.rs @@ -57,14 +57,14 @@ render!( // )?, get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, "stylesheet/main.css", )?, ]; let js_files = vec![get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, "blog_post.js", )?]; @@ -73,18 +73,18 @@ render!( render_context.config.get_site_title().map(str::to_string), Some(get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, "", )?), ); let link_to_blog_post = get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, render_context .output_file - .strip_prefix(render_context.output_directory)?, + .strip_prefix(render_context.output_root_directory)?, )?; let children = { diff --git a/src/context/blog_stream.rs b/src/context/blog_stream.rs index 9b571cc..8fc944f 100644 --- a/src/context/blog_stream.rs +++ b/src/context/blog_stream.rs @@ -57,14 +57,14 @@ render!( // )?, get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, "stylesheet/main.css", )?, ]; let js_files = vec![get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, "blog_post.js", )?]; @@ -77,7 +77,7 @@ render!( render_context.config.get_site_title().map(str::to_string), Some(get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, "", )?), @@ -151,7 +151,7 @@ render!( }; let link_to_blog_post = get_web_path( render_context.config, - render_context.output_directory, + render_context.output_root_directory, render_context.output_file, render_context .config diff --git a/src/context/render_context.rs b/src/context/render_context.rs index ce4f933..18ad7d0 100644 --- a/src/context/render_context.rs +++ b/src/context/render_context.rs @@ -8,7 +8,7 @@ use crate::error::CustomError; pub(crate) struct RenderContext<'intermediate> { pub(crate) config: &'intermediate Config, // 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, /// An optional string that gets added to IDs in HTML. @@ -28,7 +28,7 @@ impl<'intermediate> RenderContext<'intermediate> { ) -> Result, CustomError> { Ok(RenderContext { config, - output_directory, + output_root_directory: output_directory, output_file, id_addition, })