diff --git a/_config.yml b/_config.yml index a7d09fb..31aee93 100644 --- a/_config.yml +++ b/_config.yml @@ -30,11 +30,13 @@ reveal_options: # Additional reveal.js dependencies reveal_dependencies: - - "{ src: 'js/mermaid/mermaid.js' }," # Reveal.js subdirectory reveal_path: reveal.js/ +# mermaid.js diagram integration +mermaid_diagrams: true + # Exclude directories and/or files from the conversion exclude: - Gemfile* diff --git a/_layouts/reveal.html b/_layouts/reveal.html index b63b0dc..001c8bd 100644 --- a/_layouts/reveal.html +++ b/_layouts/reveal.html @@ -20,8 +20,9 @@ {% endfor %} {% endif %} +{% if site.mermaid_diagrams %} - +{% endif %} {% if site.highlight_style_sheet %} {% assign highlight_style_sheet = site.highlight_style_sheet %} @@ -85,9 +86,6 @@ - - - @@ -123,6 +121,10 @@ { src: '{{ site.reveal_path }}plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: '{{ site.reveal_path }}plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: '{{ site.reveal_path }}plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, + {% if site.mermaid_diagrams %} + { src: 'https://cdn.jsdelivr.net/npm/mermaid@9.1.6/dist/mermaid.min.js'}, + { src: '{{ 'js/mermaid/mermaid.js' | relative_url }}'}, + {% endif %} {% if site.reveal_notes_server %} { src: '{{ site.reveal_path }}socket.io/socket.io.js', async: true }, { src: '{{ site.reveal_path }}plugin/notes-server/client.js', async: true }