mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added support for using .mjs files in extra_javascript
This commit is contained in:
parent
e8c4528b41
commit
530f84416e
@ -98,7 +98,7 @@
|
||||
"items": {
|
||||
"title": "Path to JavaScript file",
|
||||
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/customization/#additional-javascript",
|
||||
"pattern": "\\.js($|\\?)"
|
||||
"pattern": "\\.m?js($|\\?)"
|
||||
},
|
||||
"uniqueItems": true,
|
||||
"minItems": 1
|
||||
|
@ -242,7 +242,11 @@
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.b4d07000.min.js' | url }}"></script>
|
||||
{% for path in config.extra_javascript %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% if path.endswith(".mjs") %}
|
||||
<script type="module" src="{{ path | url }}"></script>
|
||||
{% else %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
@ -420,7 +420,11 @@
|
||||
|
||||
<!-- Custom JavaScript -->
|
||||
{% for path in config.extra_javascript %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% if path.endswith(".mjs") %}
|
||||
<script type="module" src="{{ path | url }}"></script>
|
||||
{% else %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user