Skip to content

Commit

Permalink
Set specific version of Algolia docsearch, set SRI
Browse files Browse the repository at this point in the history
I was about to drop the SRI attributes, but then noticed that jsdelivr had some warnings:

* Skipped minification because the original files appear to be already minified.
* Original file: /npm/@docsearch/[email protected]/dist/umd/index.js
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files

So, to heed these warnings, I decided it was best to pin to a particular version of docsearch and use the pre-minified index.js to avoid dynamic modification.

Work toward Homebrew#973
  • Loading branch information
colindean authored Aug 20, 2023
1 parent d60d598 commit fc07155
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ <h1><a href="{{ site.baseurl }}/">{{ site.title }}</a></h1>
crossorigin="anonymous"
onload="loadAnchors()"
async></script>
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3/dist/umd/index.min.js"
<script src="https://cdn.jsdelivr.net/npm/@docsearch/[email protected]/dist/umd/index.js"
integrity="sha256-Y1WAhww0aFm/7xcgnD56E3jWSfKlRG9DIB2Tcs8exCQ="
crossorigin="anonymous"
onload="loadSearch('{{ page.lang }}', '{{ page.search_site }}')"
async></script>
</body>
Expand Down

0 comments on commit fc07155

Please sign in to comment.