1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 01:10:58 +01:00

Improved graceful handling of broken search when browsing locally

This commit is contained in:
squidfunk 2021-10-03 09:15:43 +02:00
parent 149b0dbc47
commit 88ed40101c
8 changed files with 37 additions and 32 deletions

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,5 +16,5 @@
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="{{ 'overrides/assets/javascripts/bundle.54f85274.min.js' | url }}"></script> <script src="{{ 'overrides/assets/javascripts/bundle.602c421d.min.js' | url }}"></script>
{% endblock %} {% endblock %}

View File

@ -20,8 +20,9 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
import { Observable, from } from "rxjs" import { EMPTY, Observable, from } from "rxjs"
import { import {
catchError,
filter, filter,
map, map,
shareReplay, shareReplay,
@ -35,6 +36,9 @@ import {
/** /**
* Fetch the given URL * Fetch the given URL
* *
* If the request fails (e.g. when dispatched from `file://` locations), the
* observable will complete without emitting a value.
*
* @param url - Request URL * @param url - Request URL
* @param options - Options * @param options - Options
* *
@ -46,6 +50,7 @@ export function request(
return from(fetch(`${url}`, options)) return from(fetch(`${url}`, options))
.pipe( .pipe(
filter(res => res.status === 200), filter(res => res.status === 200),
catchError(() => EMPTY)
) )
} }