mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-23 10:00:52 +02:00
fix(pagefind): case where baseUrl/bundleUrl not auto detected
See https://discord.com/channels/722225264733716590/1246693780191449159/1246693780191449159
This commit is contained in:
parent
2b11b7e9fb
commit
f78044d2b4
1 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue