-
-
Notifications
You must be signed in to change notification settings - Fork 37
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-material privacy plugin #196
Comments
Does it happen for all languages, even the default one? I don't have access to Insiders nor the Privacy plugin to test, but the mkdocs-static-i18n/mkdocs_static_i18n/plugin.py Lines 539 to 547 in 2d1f3c6
I would assume that the issue here could be quite similar to #110 maybe changing the order of the plugins in the mkdocs.yml file or changing the priority of the events could help.
|
Yes, it happens with the default language.
I guess I could get started on that to see if it fixes it. |
All languages including the default, even if the default language is the only language when this plugin is enabled. Moving the privacy plugin before or after i18n in mkdocs.yml doesn't make a difference unfortunately. |
Then unfortunately I'm out of ideas here. As for my additional 2 cents of unsolicited advice, I think that https://www.privacyguides.org/ is "too big" (if that's the right term) to be using this plugin in its current state. Your search_index.json is already quite big (2.8 MB), as currently all languages are joined into one file. You're also using a lot of Insiders features of the Material theme, which could happen to not be supported by this plugin. I think you might be better off with using the MkDocs recommended way and create separate language builds and join them together: The biggest issue people seem to have apart of the build process is the language switcher, but that also seems to be in development: Of course this plugin has it's perks like the custom sitemap.xml etc., just wanted to speak up with my concerns. I'm also unsure how well your site search works without the fixes I've added in #182 🤔 |
We did notice this privacyguides/privacyguides.org#1930 before we added the other languages, likely this hasn't helped though.
🤣, that's what happens when you're tired. |
This is what I was thinking recently, but aside from the couple issues I opened here this plugin has worked well, I like the automatic |
Just to chim in: The privacy plugin makes use of event priorities, so ordering should not matter for most plugins, as long as they don't define priorities themselves. Additionally, the privacy plugin got a rewrite, it's now concurrent and adds the downloaded files to MkDocs own files collection, making them visible to other plugins. I could imagine that this might be a problem with the current implementation of this plugin. I'm not familiar with the implementation, but when I read the source code, it seems that this plugin partially circumvents MkDocs event system. This might be problematic. Also, there seems to be a separate file implementation, so maybe mkdocs-static-i18n/mkdocs_static_i18n/suffix_structure.py Lines 18 to 23 in 2d1f3c6
Additionally, as already mentioned, (auto-)linking pages between languages will soon come to Material for MkDocs. For this to work properly, the sitemaps must be separate for each language, as they are heavily used by the theme. I'm, not sure how this plugin implements it, but if you have separate MkDocs builds, this is guaranteed. |
The plugin doesn't make separate distinct MkDocs builds, after it reaches the
And the plugin does already provide auto-linking of pages in the language switcher, because it enforces a static file naming scheme (aka name.lang.md) where all localized versions share the URI suffix, and differ in the language prefix, so let's hope that your additions won't cause breaking changes here 🤞 There is a line in the readme.md https://github.com/ultrabug/mkdocs-static-i18n/blob/main/README.md#compatibility-with-the-search-plugin: Lines 396 to 398 in 2d1f3c6
As you @squidfunk have created a rewrite of the search plugin do you think it would be possible to add some kind of theme.config.search_index_path or plugin.config.sitemap_path option to allow this i18n plugin to influence the JavaScript hard-coded path in your theme?https://github.com/squidfunk/mkdocs-material/blob/8014c0423c4844d94ae3fd04095f06a2e22e352d/src/assets/javascripts/bundle.ts#L114 https://github.com/squidfunk/mkdocs-material/blob/8014c0423c4844d94ae3fd04095f06a2e22e352d/src/assets/javascripts/integrations/sitemap/index.ts#L97 |
That doesn't sound like a good idea to me. There are several plugins other than the built-in search plugin that rely on the file being called Same goes for |
I'm going to close this issue because I feel like this might have been related to squidfunk/mkdocs-material#5127 (which is fixed), but I no longer use this plugin to test whether this is actually fixed, so I won't clutter up your issue tracker if nobody else uses the insiders privacy plugin alongside this one. |
https://squidfunk.github.io/mkdocs-material/setup/ensuring-data-privacy/#built-in-privacy-plugin
The privacy plugin is supposed to automatically download
mermaid.min.js
and replacehttps://unpkg.com/mermaid@9.3.0/dist/mermaid.min.js
in
bundle.ce72ebac.min.js
withhttps://<my domain>/assets/external/unpkg.com/mermaid@9.3.0/dist/mermaid.min.js
.This works fine with a standard mkdocs-material install, but after enabling the i18n plugin this no longer works. The
mermaid.min.js
file gets downloaded, but the URL in the theme's JS file no longer gets updated by the privacy plugin, so it still makes a connection to the external CDN.I can recreate this issue with the following minimal config:
mkdocs.yml
:docs/index.en.md
:The text was updated successfully, but these errors were encountered: