You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for the Pagefind options object on https://pagefind.app is wrong. Specifically, the bundlePath option doesn’t exist. Here’s the link to the page:
The WASM generated JavaScript code in pagefind.js shows that the bundlePath option doesn’t exist, and a basePath option exists instead. Here is the relevant code from pagefind.js:
varPagefindInstance=class{constructor(opts={}){this.version=pagefind_version;this.backend=wasm_bindgen;this.decoder=newTextDecoder("utf-8");this.wasm=null;this.basePath=opts.basePath||"/pagefind/";this.primary=opts.primary||false;if(this.primary&&!opts.basePath){this.initPrimary()}if(/[^\/]$/.test(this.basePath)){this.basePath=`${this.basePath}/`}if(window?.location?.origin&&this.basePath.startsWith(window.location.origin)){this.basePath=this.basePath.replace(window.location.origin,"")}this.baseUrl=opts.baseUrl||this.defaultBaseUrl();if(!/^(\/|https?:\/\/)/.test(this.baseUrl)){this.baseUrl=`/${this.baseUrl}`}this.indexWeight=opts.indexWeight??1;this.excerptLength=opts.excerptLength??30;this.mergeFilter=opts.mergeFilter??{};this.ranking=opts.ranking;this.highlightParam=opts.highlightParam??null;this.loaded_chunks={};this.loaded_filters={};this.loaded_fragments={};this.raw_ptr=null;this.searchMeta=null;this.languages=null}initPrimary(){letderivedBasePath=import.meta.url.match(/^(.*\/)pagefind.js.*$/)?.[1];if(derivedBasePath){this.basePath=derivedBasePath}else{console.warn(["Pagefind couldn't determine the base of the bundle from the import path. Falling back to the default.","Set a basePath option when initialising Pagefind to ignore this message."].join("\n"))}}defaultBaseUrl(){letdefault_base=this.basePath.match(/^(.*\/)_?pagefind/)?.[1];returndefault_base||"/"}asyncoptions(options2){constopts=["basePath","baseUrl","indexWeight","excerptLength","mergeFilter","highlightParam","ranking"];for(const[k,v]ofObject.entries(options2)){if(k==="mergeFilter"){letfilters2=this.stringifyFilters(v);letptr=awaitthis.getPtr();this.raw_ptr=this.backend.add_synthetic_filter(ptr,filters2)}elseif(k==="ranking"){awaitthis.set_ranking(options2.ranking)}elseif(opts.includes(k)){if(k==="basePath"&&typeofv==="string")this.basePath=v;if(k==="baseUrl"&&typeofv==="string")this.baseUrl=v;if(k==="indexWeight"&&typeofv==="number")this.indexWeight=v;if(k==="excerptLength"&&typeofv==="number")this.excerptLength=v;if(k==="mergeFilter"&&typeofv==="object")this.mergeFilter=v;if(k==="highlightParam"&&typeofv==="string")this.highlightParam=v}else{console.warn(`Unknown Pagefind option ${k}. Allowed options: [${opts.join(", ")}]`)}}}decompress(data,file="unknown file"){if(this.decoder.decode(data.slice(0,12))==="pagefind_dcd"){returndata.slice(12)}
The text was updated successfully, but these errors were encountered:
The documentation for the Pagefind options object on https://pagefind.app is wrong. Specifically, the
bundlePath
option doesn’t exist. Here’s the link to the page:https://pagefind.app/docs/search-config/#bundle-path
The WASM generated JavaScript code in
pagefind.js
shows that thebundlePath
option doesn’t exist, and abasePath
option exists instead. Here is the relevant code frompagefind.js
:The text was updated successfully, but these errors were encountered: