Added support for MkDocs 1.5

Co-authored-by: oprypin <371383+oprypin@users.noreply.github.com>
This commit is contained in:
squidfunk 2023-07-18 10:59:32 +01:00
parent 4bb8926686
commit e897b89125
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
2 changed files with 10 additions and 8 deletions

View File

@ -241,11 +241,11 @@
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.220ee61c.min.js' | url }}"></script>
{% for path in config.extra_javascript %}
{% if path.endswith(".mjs") %}
<script type="module" src="{{ path | url }}"></script>
{% for script in config.extra_javascript %}
{% if script.path %}
{{ script | script_tag }}
{% else %}
<script src="{{ path | url }}"></script>
<script src="{{ script | url }}"></script>
{% endif %}
{% endfor %}
{% endblock %}

View File

@ -419,11 +419,13 @@
<script src="{{ 'assets/javascripts/bundle.js' | url }}"></script>
<!-- Custom JavaScript -->
{% for path in config.extra_javascript %}
{% if path.endswith(".mjs") %}
<script type="module" src="{{ path | url }}"></script>
{% for script in config.extra_javascript %}
<!-- Detected MkDocs 1.5+ which has `script.path` and `script_tag` -->
{% if script.path %}
{{ script | script_tag }}
{% else %}
<script src="{{ path | url }}"></script>
<script src="{{ script | url }}"></script>
{% endif %}
{% endfor %}
{% endblock %}