1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-27 17:00:54 +01:00

Fixed search worker override not being respected

This commit is contained in:
squidfunk 2021-08-29 11:33:54 +02:00
parent 2d411a2b41
commit 441381b7af
5 changed files with 11 additions and 9 deletions

View File

@ -223,7 +223,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.56a63758.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.756773cc.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -95,7 +95,8 @@ export function mountSearch(
): Observable<Component<Search>> {
const config = configuration()
try {
const worker = setupSearchWorker(config.search, index$)
const url = __search?.worker || config.search
const worker = setupSearchWorker(url, index$)
/* Retrieve query and result components */
const query = getComponentElement("search-query", el)

View File

@ -39,6 +39,7 @@ import {
export interface GlobalSearchConfig {
transform?: SearchTransformFn /* Transformation function */
index?: Promise<SearchIndex> /* Alternate index */
worker?: string /* Alternate worker URL */
}
/* ------------------------------------------------------------------------- */