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.html
file.Here's my
overrides/main.html
file: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.js
file, nor can I seeworker.js
being loaded as a worker in thesources
pane.Here's what I've tried/gone through:
worker.js
file in several different places and updating theconfig
block accordingly - no change<url>
and turning on verbose mode - no errors are logged even with invalid pathworker
is loaded...I can see the
setupSearchWorker
is configured then called here with aURL
value ofconfig.search
, butconfig.search
, when I logged it out after setting upmkdocs-material
locally, seems like its being set in src/base.html.transform
, which is configured in the same__search
block is set (I think) - here. to the value inGlobalSearchConfig
, which doesn't includeworker
anywhere.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