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(
|
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 = {
|
||||||
|
@ -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
|
||||||
|
@ -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,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user