ultrabug / mkdocs-static-i18n

MkDocs i18n plugin using static translation markdown files
https://ultrabug.github.io/mkdocs-static-i18n/
MIT License
232 stars 39 forks source link

Add custom link option #134

Closed dariocurr closed 2 years ago

dariocurr commented 2 years ago

Hi, I'm @dariocurr, a developer at BuildNN

Firstly, thank you for your useful plugin.

I made this pull request because we need to specify a custom link when switching languages instead of transforming /a/page/ to /b/page/, since not all languages shares the same pages in our cases. With this edit you are able to specify a custom link such as /en (not /en/), and you'll be redirected directly to that link

The discriminant is whether the link contains a leading / or not

My pull request is missing tests on this new feature, but before implementing them I wanted to ask if you think this is a good new feature

Note: I fixed a typo in your tox.ini

ultrabug commented 2 years ago

Ciao @dariocurr sorry for my reply latency and thank you for your first contribution to this project :+1:

before implementing them I wanted to ask if you think this is a good new feature

I like the feature yes. I'm not sure I like to derive it from an option that some users are already using. I mean, we don't know if some users already use a trailing / or not so this could break their site!

Did you consider adding another option which would take precedence or prefix the link option? Like link_prefix or link_override?

Note: I fixed a typo in your tox.ini

Thanks, but both ways are valid ;) please remove it from this PR since it's not related to your proposal.

dariocurr commented 2 years ago

Hi @ultrabug, I rebased the branch and added a fixed_link option. I also implemented a new test

dariocurr commented 2 years ago

I resolved the conversations

ultrabug commented 2 years ago

Grazie :+1:

ultrabug commented 2 years ago

version 0.48 is out