-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow resources to be fetched from another location #271
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
Ideally, we have more flexibility than just a true or false for cdn. When resources cannot be sourced through a cdn, they'll still need to be found in another way. |
So I am a little lost with what would be actually required. Currently, the strategy is to fetch from a CDN to have cache benefits and parallel loading. If the CDN fails we send the local version. This strategy does not really benefit books that are not hosted online though. But I am not sure it hurts either. If someone could clearly formulate the problem that needs to be solved and what they expect mdBook to do or allow, that would help us immensely! :) |
Alright. The problem is as follows. The solution to our problem would be if mdbook could be supplied with alternative means to retrieve third-party dependencies, rather than having the current CDN+fallback method hardcoded. Then debian could ship rust with the books configured to use the debian locations. If this is something your project is willing to consider, I could provide a patch and we could work from there. |
Ooh I see now, thank you for the explanation! |
I've created a new PR (#541) for updating config values using environment variables which is the first step required for fixing this issue. The HTML renderer needs to be cleaned up and restructured now that #507 has landed, so hopefully the second half of this issue (the concept of a configurable |
Some resources are loaded through a CDN if possible with a local fallback. An option to deactivate the CDNs when rendering is wanted. See #46
An option could be given in the config file, but I think it would fit better as a CLI argument.
On the template side, we could add a
cdn
variable that evaluates to true or false and useif ...
tags in handlebars.The text was updated successfully, but these errors were encountered: