Closed ctubbsii closed 3 months ago
I don't think we should do this, as explained above, but if one really wanted to add the integrity checks back in, it would be something like:
shopt -s globstar
algo=sha384 # could replace with sha512
for x in css/*/**/*.css; do
echo "<link rel=\"stylesheet\" type=\"text/css\" integrity=\"$algo-$(<$x openssl dgst -binary -$algo|openssl base64 -A)\" href=\"{{ site.baseurl }}/$x\">"
done
for x in js/*/**/*.js; do
echo "<script type=\"text/javascript\" integrity=\"$algo-$(<$x openssl dgst -binary -$algo|openssl base64 -A)\" src=\"{{ site.baseurl }}/$x\"></script>"
done
(Note: I'm not sure if the order matters... some resources depend on other resources. So, you might not be able to use this output directly, but may have to re-order things.)
@EdColeman I had to include the fonts from fontawesome also, so I've pushed an update after your review.
Wasn't there a discussion somewhere else about not using minified resources? Or does that not apply in this case?
Wasn't there a discussion somewhere else about not using minified resources? Or does that not apply in this case?
That is true for project source code that we release. Minified resources are not considered "open source" software, so we should not distribute them as such. However, for the website, we're just using them as libraries... we're not distributing them as part of our open source software releases.
See https://whimsy.apache.org/site/project/accumulo
<script>
from_includes/scripts.html
, which contained our own custom scripts for our site, into its own.js
file.This fixes #420