Sha256: 28e440d30d7493a8bc26b99b4280fad16b3a8e81af6ed0dd4d6cc9982ad5c6cf

Contents?: true

Size: 1.5 KB

Versions: 20

Compression:

Stored size: 1.5 KB

Contents

{% comment %}
The complexity of this file comes from a breaking change in Mermaid v10; mermaid.init has been deprecated (and supposedly, didn't work earlier?).

So, we check whether the user's Mermaid version is >= 10; if not, we fall back to the previous init syntax.

If a user is using a custom mermaid file and doesn't specify a version, we default to the < v10 behaviour. Users who use version v10 or above should specify this in the version key.
{% endcomment %}

{% if site.mermaid.version %}
  {% assign mermaid_major_version = site.mermaid.version | split: "." | first | plus: 0 %}
{% else %}
  {% assign mermaid_major_version = 9 %}
{% endif %}

{% if mermaid_major_version > 9 %}

<script type="module">
  {% if site.mermaid.path %}
  import mermaid from '{{ site.mermaid.path | relative_url }}';
  {% else %}
  import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@{{ site.mermaid.version }}/dist/mermaid.esm.min.mjs';
  {% endif %}

  var config = {% include mermaid_config.js %};
  mermaid.initialize(config);
  mermaid.run({
    querySelector: '.language-mermaid',
  });
</script>

{% else %}

{% 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 %}

<script>
  var config = {% include mermaid_config.js %};
  mermaid.initialize(config);
  window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
</script>

{% endif %}

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
just-the-docs-0.10.0 _includes/components/mermaid.html
just-the-docs-0.9.0 _includes/components/mermaid.html
opendevsecops-jekyll-0.1.2 _includes/components/mermaid.html
opendevsecops-jekyll-0.1.1 _includes/components/mermaid.html
opendevsecops-jekyll-0.1.0 _includes/components/mermaid.html
just-the-docs-0.8.2 _includes/components/mermaid.html
just-the-docs-0.8.1 _includes/components/mermaid.html
just-the-docs-0.8.0 _includes/components/mermaid.html
just-the-docs-0.7.0 _includes/components/mermaid.html
just-the-docs-0.6.2 _includes/components/mermaid.html
just-the-docs-0.6.1 _includes/components/mermaid.html
just-the-docs-0.6.0 _includes/components/mermaid.html
just-the-docs-0.5.4 _includes/components/mermaid.html
just-the-docs-peter-0.1.3 _includes/components/mermaid.html
just-the-docs-peter-0.1.2 _includes/components/mermaid.html
just-the-docs-peter-0.1.1 _includes/components/mermaid.html
just-the-docs-0.5.3 _includes/components/mermaid.html
just-the-docs-0.5.2 _includes/components/mermaid.html
just-the-docs-0.5.1 _includes/components/mermaid.html
just-the-docs-0.5.0 _includes/components/mermaid.html