diff --git a/docs/schema.json b/docs/schema.json index d04afb354..f1677d463 100644 --- a/docs/schema.json +++ b/docs/schema.json @@ -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 diff --git a/material/base.html b/material/base.html index bfd6af4be..95a8d9edd 100644 --- a/material/base.html +++ b/material/base.html @@ -242,7 +242,11 @@ {% block scripts %} {% for path in config.extra_javascript %} - + {% if path.endswith(".mjs") %} + + {% else %} + + {% endif %} {% endfor %} {% endblock %} diff --git a/src/base.html b/src/base.html index c18066231..eb8205a5b 100644 --- a/src/base.html +++ b/src/base.html @@ -420,7 +420,11 @@ {% for path in config.extra_javascript %} - + {% if path.endswith(".mjs") %} + + {% else %} + + {% endif %} {% endfor %} {% endblock %}