ultrabug / mkdocs-static-i18n

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

[Request] Excluding folders from localization #264

Open usulpt opened 1 year ago

usulpt commented 1 year ago

hello! would it be possible to exclude one or more folders from being localized? api documentation, for example?

thanks and keep up the great work!

ultrabug commented 1 year ago

Hi @usulpt ; it's hard to understand what you mean exactly by this.

Could you provide a sample docs structure and explain from there?

AIboy996 commented 6 months ago

Same issue. Later I will make a pull request on this.

AIboy996 commented 6 months ago

@usulpt hei, I modify some code to support exclude one or more folders from being localized, you can check https://github.com/AIboy996/mkdocs-static-i18n.

It works like: mkdocs-i18n

All files in ignored folder will be redirected to default language page(but not simple redirect, in fact these page will not be built).

FYI, if you want to install the modified version, just type:

pip install git+https://github.com/AIboy996/mkdocs-static-i18n --force-reinstall

then you can ignore some folder inmkdocs.yml:

plugins:
  - search
  - i18n:
      docs_structure: suffix
      exclude_folders:
        - docs/setup

hope it helps.

And @ultrabug maybe this can be considered to include as a formal config option for mkdocs-static-i18n.

AIboy996 commented 6 months ago

Since i am not familar with mkdocs-static-i18n source code enough. I am not sure the modification is appropriate.(it will trigger some WARNINGs from mkdocs.structure.nav.get_navagation) So I won’t initiate a pull request qwq__