Rename the output root directory in the render context.
This commit is contained in:
parent
2e1c979127
commit
1581e5c401
@ -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 = {
|
||||
|
@ -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
|
||||
|
@ -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<RenderContext<'intermediate>, CustomError> {
|
||||
Ok(RenderContext {
|
||||
config,
|
||||
output_directory,
|
||||
output_root_directory: output_directory,
|
||||
output_file,
|
||||
id_addition,
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user