|
@@ -57,7 +57,7 @@ impl FileInfo { |
|
|
let mut parent = file_path.parent().expect("Get parent of page").to_path_buf(); |
|
|
let mut parent = file_path.parent().expect("Get parent of page").to_path_buf(); |
|
|
let name = path.file_stem().unwrap().to_string_lossy().to_string(); |
|
|
let name = path.file_stem().unwrap().to_string_lossy().to_string(); |
|
|
let mut components = find_content_components( |
|
|
let mut components = find_content_components( |
|
|
&file_path.strip_prefix(base_path).expect("Strip base path prefix for page"), |
|
|
|
|
|
|
|
|
&file_path.strip_prefix(base_path).unwrap_or(&file_path), |
|
|
); |
|
|
); |
|
|
let relative = if !components.is_empty() { |
|
|
let relative = if !components.is_empty() { |
|
|
format!("{}/{}.md", components.join("/"), name) |
|
|
format!("{}/{}.md", components.join("/"), name) |
|
@@ -92,7 +92,7 @@ impl FileInfo { |
|
|
let parent = path.parent().expect("Get parent of section").to_path_buf(); |
|
|
let parent = path.parent().expect("Get parent of section").to_path_buf(); |
|
|
let name = path.file_stem().unwrap().to_string_lossy().to_string(); |
|
|
let name = path.file_stem().unwrap().to_string_lossy().to_string(); |
|
|
let components = find_content_components( |
|
|
let components = find_content_components( |
|
|
&file_path.strip_prefix(base_path).expect("Strip base path prefix for section"), |
|
|
|
|
|
|
|
|
&file_path.strip_prefix(base_path).unwrap_or(&file_path), |
|
|
); |
|
|
); |
|
|
let relative = if !components.is_empty() { |
|
|
let relative = if !components.is_empty() { |
|
|
format!("{}/{}.md", components.join("/"), name) |
|
|
format!("{}/{}.md", components.join("/"), name) |
|
|