Skip to content

Commit

Permalink
Added support for MkDocs 1.5
Browse files Browse the repository at this point in the history
Co-authored-by: oprypin <371383+oprypin@users.noreply.github.com>
  • Loading branch information
squidfunk and oprypin committed Jul 18, 2023
1 parent 4bb8926 commit e897b89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
10 changes: 6 additions & 4 deletions src/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit e897b89

Please sign in to comment.