EddyLuten / mkdocs-alias-plugin

An MkDocs plugin allowing links to your pages using a custom alias
MIT License
12 stars 2 forks source link

Option to use relative url #3

Closed SimonDelmas closed 1 year ago

SimonDelmas commented 1 year ago

I use your plugin for a project documentation and I really enjoy it!

I recently encountered a problem with the alias link, as the url used for replacement is an absolute url. Indeed my documentation site is hosted on a specific route: https://my_site.net/my_project/documentation/ In this case using an absolute url resulted in a link that points to the wrong destination : https://my_site.net/my_alias instead of https://my_site.net/my_project/documentation/my_alias

I would like to add an option to make the link relative to the current page to fix this issue.

EddyLuten commented 1 year ago

Hi, thanks for reporting this issue, @SimonDelmas! I noticed that you closed your PR. Is this issue still valid?

SimonDelmas commented 1 year ago

Hi @EddyLuten, I did a PR yesterday to propose you an option to fix my issue, but I went too fast and the patch did not correct my problem... I have just submitted another cleaner proposal.

It consist in adding an option "use_relative_link" to define links relative to the page path instead of using absolute path. Let me know if you agree with this.

EddyLuten commented 1 year ago

Thanks, your solution could be helpful for a wide variety of folks. I will push this new feature out in the next minor release after I update the readme, etc.

Thanks for your contribution!