-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
It looks like the code that generates the URL that users navigate to when clicking on the "Suggest an edit" button (added in #1506) assumes that your documentation is stored in a directory called src
.
mdBook/src/renderer/html_handlebars/hbs_renderer.rs
Lines 40 to 50 in 7e7e779
if let Some(ref edit_url_template) = ctx.html_config.edit_url_template { | |
let full_path = "src/".to_owned() | |
+ ch.source_path | |
.clone() | |
.unwrap_or_default() | |
.to_str() | |
.unwrap_or_default(); | |
let edit_url = edit_url_template.replace("{path}", &full_path); | |
ctx.data | |
.insert("git_repository_edit_url".to_owned(), json!(edit_url)); | |
} |
As I've customised the directory where my documentation files are stored by using the src
config option (to be docs/
instead), I end up getting a 404 when I click the "Suggest an edit" menu item button.
When I click the button, I'm lead to https://github.com/anoadragon453/examplerepo/edit/develop/src/README.md instead of https://github.com/anoadragon453/examplerepo/edit/develop/docs/README.md.
I believe the above code just needs to read from the value of the src
config option, and default to "src"
if it's not set.