-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Privacy plugin doesn't fetch Google fonts on Windows #4009
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
Comments
Thanks for reporting. Unfortunately, I don't have Windows at my disposal, but I agree that it's very likely related to path problems. I'll see how I can troubleshoot. If it's okay for you, we do this in lockstep together. Any help is appreciated! |
Fixed in |
The fix was just released as part of 8.3.4+insiders.4.18.0. Please reopen when the issue persists. |
Sorry, I think we have to reopen this issue or create a new one. Your commit did fix the issue regarding Google webfonts not being included in the output. However, there's a second problem which causes the exception given above. It's caused by So if you're working on a Windows machine without admin rights, include the privacy plugin, have assets that require symlinking, and want to build locally, the exception will be raised. Is symlinking really required here? Can we find something else for Windows projects? (Or at least display a warning if the OS is Windows and you don't have admin rights. And skip symlinking.) |
Symlinking is necessary to cache files without file extensions. For example, GitHub serves avatars under the following URL: If we use this URL in a Markdown file or HTML template, which then gets compiled to HTML that is run through the privacy plugin, the plugin will download the file and save it under <!-- won't work -->
<img src="./assets/externals/avatars.githubusercontent.com/u/932156" />
<!-- works -->
<img src="./assets/externals/avatars.githubusercontent.com/u/932156.png" /> For this reason, we need to rename the file and append the file extension before replacing it. The problem is that now we can't use the cache anymore, as the privacy plugins will again receive the extension-free URL on repeated compilation and doesn't know that we already downloaded it. For this reason, we create a symlink to notify the plugin of "we already downloaded it, but we needed to modify the filename, so it works without serving it through a web browser". Edge cases all the way down. I hope that the explanation sheds some light on why this is necessary. I understand that Python symlinking on Windows doesn't work for non-admin users, which is unfortunate. I don't have Windows at my disposal, so I can only guess. What we could do for Windows is catch any symlinking errors and just swallow them, circumventing the cache, thus downloading the image on every build. That would need some hackery, but it's certainly possible. I'm not aware of another solution to this problem, but I'm happy to discuss if somebody has a better idea. |
All in all, please create a new issue, as it's only loosely related to this one. |
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
On Windows, the privacy plugin doesn't properly fetch the Google webfonts.
Here's a stripped-down test project to reproduce the error:
test-privacy-bug.zip
If you build this project under Windows, the output looks like this:
test-privacy-bug-output.zip
You can see that the Google fonts are missing in /site/assets/externals.
In our main project, we couldn't even build. Instead, an exception was raised:
I assume it's one of the usual problems related to different path syntax on Windows and Unix (slash vs. backslash).
Expected behaviour
See description
Actual behaviour
See description
Steps to reproduce
See description
Package versions
Configuration
See description
System information
The text was updated successfully, but these errors were encountered: