summaryrefslogtreecommitdiff
path: root/src/collect_files.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/collect_files.rs')
-rw-r--r--src/collect_files.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/collect_files.rs b/src/collect_files.rs
index cf39ebe..dfcc847 100644
--- a/src/collect_files.rs
+++ b/src/collect_files.rs
@@ -296,13 +296,15 @@ impl Website {
let path = make_url_safe(&segments.join("/"));
for page in &self.pages {
if page.full_url == path {
+ let root = from.root();
if let Some(heading) = heading {
if !page.headings.iter().any(|h| h.url == make_url_safe(heading)) {
warn!("Page {:?} contains link to nonexistent heading {heading:?} on page {path:?}", from.name());
}
+ return Some(format!("{root}{path}.{ext}#{heading}"));
+ } else {
+ return Some(format!("{root}{path}.{ext}"));
}
- let root = from.root();
- return Some(format!("{root}{path}.{ext}"));
}
}
return None;