mkdocs-static-i18n icon indicating copy to clipboard operation
mkdocs-static-i18n copied to clipboard

Add custom link option

Open dariocurr opened this issue 2 years ago • 2 comments

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

dariocurr avatar Aug 31 '22 14:08 dariocurr

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.

ultrabug avatar Sep 08 '22 20:09 ultrabug

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

dariocurr avatar Sep 09 '22 11:09 dariocurr

I resolved the conversations

dariocurr avatar Sep 21 '22 13:09 dariocurr

Grazie :+1:

ultrabug avatar Oct 14 '22 15:10 ultrabug

version 0.48 is out

ultrabug avatar Oct 14 '22 16:10 ultrabug