Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with mkdocs-gen-files plugin #263

Open
dvolodin7 opened this issue Sep 22, 2023 · 1 comment
Open

Incompatible with mkdocs-gen-files plugin #263

dvolodin7 opened this issue Sep 22, 2023 · 1 comment

Comments

@dvolodin7
Copy link

mkdocs-static-i18n v1.0.6 is incompatible with mkdocs-gen-files plugin.

The following warning is emitted for every auto-generated page

WARNING -  mkdocs_static_i18n: Unhandled file case - connection-types-reference/juniper.md

and then, the page is removed from navigation and not being rendered at all.

The root of the problem is in reconfigure.py in the reconfigure_files function. Exactly, in this condition

            if is_relative_to(file.abs_src_path, mkdocs_config.docs_dir):

Files, generated by mkdocs-gen-file have abs_src_path in the temporary directory. i.e.

File(
    src_uri='connection-types-reference/juniper.md',
   dest_uri='connection-types-reference/juniper/index.html',
   name='juniper',
   url='connection-types-reference/juniper/'
)
abs_src_path=/tmp/mkdocs_gen_files_cg_osgf4/connection-types-reference/juniper.md

As a result, the condition is not satisfied and the file is excluded.

I think we cannot rely on physical file location as the criteria. Maybe

file.is_documentation_page()

is a better criteria?

@dvolodin7
Copy link
Author

Just found the same bug affects the mkdocs-material blog plugin as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant