mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 05:13:33 -06:00
Add configuration key to load a local version of mermaid (#1153)
Hi there! Thank you for the great theme! I am a happy user and was delighted to see that mermaid support has landed. In some cases the usage of jsDelivr might not be possible for technical or compliance reasons. This commit adds a second way to include the mermaid lib by specifying a path in the mermaid config. This way a local version of the lib can be used. It should be fully backwards compatible, not requiring any action by users that already include the lib from the CDN. I already added some documentation, but I am also happy to extend this, if this change is generally well-received. Cheers, Christian
This commit is contained in:
committed by
GitHub
parent
cf72c436d9
commit
b2bbdb7040
@@ -23,13 +23,17 @@
|
||||
{% endif %}
|
||||
|
||||
{% if site.mermaid %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid@{{ site.mermaid.version }}/dist/mermaid.min.js"></script>
|
||||
{% if site.mermaid.path %}
|
||||
<script src="{{ site.mermaid.path | relative_url }}"></script>
|
||||
{% else %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid@{{ site.mermaid.version }}/dist/mermaid.min.js"></script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<script src="{{ '/assets/js/just-the-docs.js' | relative_url }}"></script>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
{% for file in site.static_files %}
|
||||
{% if file.path == site.favicon_ico or file.path == '/favicon.ico' %}
|
||||
{% assign favicon = true %}
|
||||
|
Reference in New Issue
Block a user