oprypin/mkdocs-same-dir

Feature request: Correct "edit this page" button when `repo_url` is set

rmartine-ias opened this issue · 2 comments

The "Edit this page" button currently displayed on the generated docs page when repo_url is set in mkdocs.yml is not linking to the correct page when mkdocs-same-dir is in use.

Screenshot 2023-04-26 at 11 23 51 AM

For instance, if the URL is https://github.com/org/repo/edit/master/docs/README.md, the button currently links to https://github.com/org/repo/edit/master/README.md. This feature request is for the plugin to patch the button to link to the actual URL, instead of the one containing docs/.

If this is a desired feature, I can probably pull some time to work on it in the next few weeks.

Thanks for the inquiry.

MkDocs actually has no awareness of what the correct directory is. Regardless of this plugin, if you put your documentation into a crocs/ directory and not docs/, the default value of edit_uri is 'edit/master/docs/'. (or I usually set it to blob/master/docs/).

As such, you can just add edit_uri: blob/master/ to your MkDocs config if you're using the root directory.

Thank you so much! Making this change.