diff --git a/docs/schema.json b/docs/schema.json index d04afb3541b..f1677d463a0 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 bfd6af4bec2..95a8d9edd01 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 c180662311e..eb8205a5b61 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 %}