Replies: 1 comment 5 replies
-
|
Good catch. The search customization documentation is outdated, the variable was removed. You can open an issue, so we can fix it. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've spent a good enough time on this that it's probably better for my sanity to get some help.
I want search to query a search API I'm setting up instead of the default local lunr setup. I found and read through https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#custom-search.
The problem is, I can't get any (arbitrary) code to run in any file I place in the config block of my
overrides/main.htmlfile.Here's my
overrides/main.htmlfile:And here's
docs/worker.js:With this setup, I can see
query is: ...being logged to the console whenever I type. But I can't see any logs from myworker.jsfile, nor can I seeworker.jsbeing loaded as a worker in thesourcespane.Here's what I've tried/gone through:
worker.jsfile in several different places and updating theconfigblock accordingly - no change<url>and turning on verbose mode - no errors are logged even with invalid pathworkeris loaded...I can see the
setupSearchWorkeris configured then called here with aURLvalue ofconfig.search, butconfig.search, when I logged it out after setting upmkdocs-materiallocally, seems like its being set in src/base.html.transform, which is configured in the same__searchblock is set (I think) - here. to the value inGlobalSearchConfig, which doesn't includeworkeranywhere.So gist is, I'm not sure why my custom worker isn't being loaded, and from the code I can't see how it's configurable, so I'm guessing I'm missing something in the flow.
Any insight would be greatly appreciated, thanks!
Beta Was this translation helpful? Give feedback.
All reactions