Skip to content

Commit

Permalink
treat markdown internal link content/ as @/
Browse files Browse the repository at this point in the history
  • Loading branch information
theowenyoung committed Mar 23, 2022
1 parent b66a4f2 commit b0b463a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions components/rendering/src/markdown.rs
Expand Up @@ -89,6 +89,19 @@ fn fix_link(
return Err(format!("Relative link {} not found.", link).into());
}
}
} else if link.starts_with("content/") {
// support content/ absolute link, treat content/ as @/
// replace content/ with @/
let content_root_lkink = link.replacen("content/", "@/", 1);
match resolve_internal_link(&content_root_lkink, &context.permalinks) {
Ok(resolved) => {
internal_links.push((resolved.md_path, resolved.anchor));
resolved.permalink
}
Err(_) => {
return Err(format!("Relative link {} not found.", link).into());
}
}
} else {
if is_external_link(link) {
external_links.push(link.to_owned());
Expand Down

0 comments on commit b0b463a

Please sign in to comment.