-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Load external scripts over HTTPS with Subresource integrity checking #159
Comments
Yes but about Subresource integrity I have to check if not breaking browser that does not support it yet (Edge mostly) https://caniuse.com/#search=integrity |
Check out H5BP for fallback. You could also just download these resources and load them locally. This allows the site to own the source code of the scripts and improves security without jumping through hoops. |
@JHabdas its what I did previously (locally stored) but most of user forget to build theme in order to retrieve script from |
tested on Edge SRI is not validated as expected but script is still loaded so it's ok :) |
What I like to do is eschew bower (unless I'm rolling libraries), create simple NPM scripts to copy assets so they can be version controlled and easily upgraded in the package manifest and, if necessary, use jgthms/bulma#643 (clean-css NPM scripts example I did for Burma) Doing you can skip all the SRI stuff and keep things easier so users can spend more time eking out the performance they really need and others can learn from individual forks. |
To add a little more color, I like to think about not having the perfect developer workflow, but a very good user experience (as users won't be upgrading this stuff all that often in most cases, and if they are they can bring their own build pipeline with something like hugulp. Hope that helps. |
Yes but was not about But I'm totally agree with you, that can be a great addition to offer possibility to do not depend on external CDN, and not so costly to develop (a bit more for me because I'm not a day to day frontend developer so I not familiar with In addition to hugulp I saw that project spotted https://github.com/netlify/victor-hugo from news Smashing magazine using Hugo and way more faster (something like that title) |
Also worth noting, because GitHub won't list forks when there are too many consider adding a beacon to call analytics so you can get referrer data for those who haven't customized the copyright stuff in the footer. I've used this technique in AD and it allowed me to start building a list of sites others can learn from: https://github.com/comfusion/after-dark/wiki |
I have started https://github.com/kakawait/hugo-tranquilpeak-theme/wiki/Showcase but I'm not tracking myself site using Tranquilpeak I'm waiting that people allow and share with me their blog 👍 |
Not being a front-ender, I would avoid Webpack like the plague if you can help it: I've already opened a few issues against victor regarding patterns they're letting people fall into and if you see in their closed issues users have already been asking for something more simple. EDIT: Nice touch with the images in the showcase. |
@JHabdas Yeah I just starred the project, I didn't checkout more. So I can't tell you more about Victor. And similar to Hugulp I starred long time ago https://github.com/ktmud/huggle but same as Victor I didn't spend much time on it. |
You may also really enjoy: https://github.com/adrinux/web-starter-hugo |
For posterity, here's a list of asset pipelines (I just stared a list): https://github.com/ktmud/huggle/ |
@JHabdas thank for every links and analysis/discussion 👍
|
You're on fire |
I will keep it open until merge back and release to mastee |
You now have the same capability for |
Good stuff. Just a heads up, if users want to add something like Popper.js they'll be all set given it's a single file. If they go for a PhotoSwipe gallery, a composite library, however, they won't be able to download both of it of its scripts asynchronously. Though I do have a solution for that. So just let me know if asynchronous dependency management becomes a burden or users start to open issues about Theme performance on slower connections. |
src="//"
->src="https://
https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
The text was updated successfully, but these errors were encountered: