mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed #1877: 404 on search index when search is disabled
This commit is contained in:
parent
f46334a955
commit
989b8597c5
File diff suppressed because one or more lines are too long
1
material/assets/javascripts/bundle.a8472eec.min.js.map
Normal file
1
material/assets/javascripts/bundle.a8472eec.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.b7ed72fe.min.js",
|
"assets/javascripts/bundle.js": "assets/javascripts/bundle.a8472eec.min.js",
|
||||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.b7ed72fe.min.js.map",
|
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.a8472eec.min.js.map",
|
||||||
"assets/javascripts/vendor.js": "assets/javascripts/vendor.d1f5a259.min.js",
|
"assets/javascripts/vendor.js": "assets/javascripts/vendor.d1f5a259.min.js",
|
||||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.d1f5a259.min.js.map",
|
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.d1f5a259.min.js.map",
|
||||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.fae956e7.min.js",
|
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.fae956e7.min.js",
|
||||||
|
@ -183,7 +183,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/vendor.d1f5a259.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/vendor.d1f5a259.min.js' | url }}"></script>
|
||||||
<script src="{{ 'assets/javascripts/bundle.b7ed72fe.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.a8472eec.min.js' | url }}"></script>
|
||||||
{%- set translations = {} -%}
|
{%- set translations = {} -%}
|
||||||
{%- for key in [
|
{%- for key in [
|
||||||
"clipboard.copy",
|
"clipboard.copy",
|
||||||
|
@ -237,32 +237,35 @@ export function initialize(config: unknown) {
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* Search worker */
|
/* Search worker - only if search is present */
|
||||||
const worker$ = defer(() => {
|
const worker$ = useComponent("search")
|
||||||
const index = config.search && config.search.index
|
.pipe(
|
||||||
? config.search.index
|
switchMap(() => defer(() => {
|
||||||
: undefined
|
const index = config.search && config.search.index
|
||||||
|
? config.search.index
|
||||||
|
: undefined
|
||||||
|
|
||||||
/* Fetch index if it wasn't passed explicitly */
|
/* Fetch index if it wasn't passed explicitly */
|
||||||
const index$ = typeof index !== "undefined"
|
const index$ = typeof index !== "undefined"
|
||||||
? from(index)
|
? from(index)
|
||||||
: base$
|
: base$
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(base => ajax({
|
switchMap(base => ajax({
|
||||||
url: `${base}/search/search_index.json`,
|
url: `${base}/search/search_index.json`,
|
||||||
responseType: "json",
|
responseType: "json",
|
||||||
withCredentials: true
|
withCredentials: true
|
||||||
})
|
})
|
||||||
.pipe<SearchIndex>(
|
.pipe<SearchIndex>(
|
||||||
pluck("response")
|
pluck("response")
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return of(setupSearchWorker(config.search.worker, {
|
return of(setupSearchWorker(config.search.worker, {
|
||||||
base$, index$
|
base$, index$
|
||||||
}))
|
}))
|
||||||
})
|
}))
|
||||||
|
)
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user