Skip to content

Commit

Permalink
fix(pagefind): case where baseUrl/bundleUrl not auto detected
Browse files Browse the repository at this point in the history
  • Loading branch information
gcushen committed Jun 2, 2024
1 parent 2b11b7e commit f78044d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/blox-tailwind/layouts/partials/libraries.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
{{ $pf_js = $pf_js | resources.Fingerprint "sha256" }}
<script src="{{ $pf_js.RelPermalink }}" integrity="{{ $pf_js.Data.Integrity }}"></script>

{{ $search_config := dict "baseUrl" (relURL "") }}
{{ printf "<script>window.hbb.pagefind = %s;</script>" ($search_config | jsonify) | safeHTML }}

<style>
html.dark {
--pagefind-ui-primary: #eeeeee;
Expand All @@ -27,7 +30,12 @@

<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: "#search", showSubResults: true });
new PagefindUI({
element: "#search",
showSubResults: true,
baseUrl: window.hbb.pagefind.baseUrl,
bundlePath: window.hbb.pagefind.baseUrl + "pagefind/",
});
});
document.addEventListener('DOMContentLoaded', () => {
let element = document.getElementById('search');
Expand Down

0 comments on commit f78044d

Please sign in to comment.