-
Notifications
You must be signed in to change notification settings - Fork 337
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
Avoid exernal assets #2249
Avoid exernal assets #2249
Conversation
This is configurable via YAML option `template.params.external_assets`.
(`fs::path_norm()` unfortunately squishes consecutive slashes)
Next step could be asset bundling (and minification) into a single CSS and JS file each to reduce the number of requests on page load. Given there's some adequate toolchain available for this in R (which I don't know of)...
|
This should fix asset file integrity validation on Windows.
and restructure/simplify code
…sets # Conflicts: # R/theme.R
and fix spelling
# Conflicts: # DESCRIPTION # NEWS.md
@salim-b I'm planning to merge this into pkgdown 2.10, which I'll start working on soon. Thanks for continuing to keep this PR up-to-date! |
Cool! Let me know if you want me to continue working on the refinements we discussed above. |
@salim-b I started from your PR, but it's diverged quite a lot 😄 I think there are two key ideas here now:
|
I also ended up converting the YAML file to R code; in the end I think this is pretty much a net neutral but at various points in my refactoring it seems to make more sense. And there's something nice to keeping all of the dependency code in R. |
@hadley This looks great!
What came to mind though is that if we want to support asset URLs that always point to the latest release of an asset like the ones Pandoc (3.2+) uses for MathJax 31 and KaTeX2, we might want to set Footnotes |
@salim-b yeah, I was thinking we'd need to do some extra work for the math handling, but with this in place it'll be easier enough to do in separate PR. |
Now turn them into HTML dependencies objects, caching them in the user cache directory. Fixes r-lib#2099. --------- Co-authored-by: Hadley Wickham <[email protected]>
Directly includes all external assets (JS, CSS, fonts) from first-party plus switches to the minified version of
fuse.js
. Only implemented for BS5 (old BS3 is left untouched). All external assets are centrally defined in new YAML fileinst/BS5/assets_external.yaml
which should make future asset maintenance easy.Direct asset inclusion might be relevant to people trying to strictly adhere to privacy regulations like GDPR, since otherwise IP addresses of site visitors are sent to the asset CDN operators (based in the US) on page load.
Note that the newly imported openssl package used to validate downloaded file hashes was already an indirect mandatory dependence due to the httr import.
Successor to #1541. Fixes #2099.