Generate render link based on path to file.
This commit is contained in:
@@ -143,7 +143,29 @@ impl LinkTarget {
|
||||
.unwrap_or_default(),
|
||||
target_id
|
||||
))),
|
||||
LinkTarget::Image { src, .. } => Ok(Some(src.clone())),
|
||||
LinkTarget::Image { src, .. } => {
|
||||
let path_to_file = render_context
|
||||
.dependency_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.get_current_folder()?
|
||||
.join(src)
|
||||
.canonicalize()?;
|
||||
let input_root_directory = render_context.config.get_root_directory();
|
||||
let relative_path_to_file = path_to_file.strip_prefix(input_root_directory)?;
|
||||
dbg!(input_root_directory);
|
||||
dbg!(&path_to_file);
|
||||
dbg!(relative_path_to_file);
|
||||
let web_path = get_web_path(
|
||||
render_context.config,
|
||||
render_context.output_root_directory,
|
||||
render_context.output_file,
|
||||
relative_path_to_file,
|
||||
)?;
|
||||
dbg!(&web_path);
|
||||
// TODO: Record interest in copying the file to output.
|
||||
Ok(Some(web_path))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user