From 530f84416e50e517991b6f1cd44ce8192421bce0 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Tue, 30 May 2023 19:40:58 +0200 Subject: [PATCH] Added support for using .mjs files in extra_javascript --- docs/schema.json | 2 +- material/base.html | 6 +++++- src/base.html | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) 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 %}