mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-28 01:10:58 +01:00
Automatically add iframe-worker in offline plugin
This commit is contained in:
parent
e3b1bcf179
commit
c1c186fa0f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -23,5 +23,5 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script src="{{ 'assets/javascripts/custom.7c807b8d.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/custom.a066854d.min.js' | url }}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
File diff suppressed because one or more lines are too long
29
material/assets/javascripts/bundle.ddfd5641.min.js
vendored
Normal file
29
material/assets/javascripts/bundle.ddfd5641.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -244,7 +244,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.b062512d.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.ddfd5641.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 %}
|
||||||
|
@ -46,6 +46,12 @@ class OfflinePlugin(BasePlugin[OfflinePluginConfig]):
|
|||||||
# Ensure correct resolution of links
|
# Ensure correct resolution of links
|
||||||
config.use_directory_urls = False
|
config.use_directory_urls = False
|
||||||
|
|
||||||
|
# Append iframe-worker to polyfills/shims
|
||||||
|
config.extra.polyfills = config.extra.get("polyfills", [])
|
||||||
|
if not any("iframe-worker" in url for url in config.extra.polyfills):
|
||||||
|
worker = "https://unpkg.com/iframe-worker/shim"
|
||||||
|
config.extra.polyfills.append(worker)
|
||||||
|
|
||||||
# Support offline search (run latest)
|
# Support offline search (run latest)
|
||||||
@event_priority(-100)
|
@event_priority(-100)
|
||||||
def on_post_build(self, *, config):
|
def on_post_build(self, *, config):
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "iframe-worker/shim"
|
|
||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
Subject,
|
Subject,
|
||||||
|
@ -46,6 +46,12 @@ class OfflinePlugin(BasePlugin[OfflinePluginConfig]):
|
|||||||
# Ensure correct resolution of links
|
# Ensure correct resolution of links
|
||||||
config.use_directory_urls = False
|
config.use_directory_urls = False
|
||||||
|
|
||||||
|
# Append iframe-worker to polyfills/shims
|
||||||
|
config.extra.polyfills = config.extra.get("polyfills", [])
|
||||||
|
if not any("iframe-worker" in url for url in config.extra.polyfills):
|
||||||
|
worker = "https://unpkg.com/iframe-worker/shim"
|
||||||
|
config.extra.polyfills.append(worker)
|
||||||
|
|
||||||
# Support offline search (run latest)
|
# Support offline search (run latest)
|
||||||
@event_priority(-100)
|
@event_priority(-100)
|
||||||
def on_post_build(self, *, config):
|
def on_post_build(self, *, config):
|
||||||
|
Loading…
Reference in New Issue
Block a user