add mermaid

master
iotcat 4 years ago
parent 10f04c4e4c
commit 49ef3bd908
  1. 4
      layout/_script/libs.swig
  2. 11
      layout/_script/pjax.swig
  3. 9
      source/lib/mermaid/mermaid.min.js
  4. 1
      source/lib/mermaid/mermaid.min.js.map

@ -1,6 +1,9 @@
{%- if theme.fancybox -%}
{%- set fancybox_js = 'fancybox/jquery.fancybox.pack.js' -%}
{%- endif -%}
{%- if theme.mermaid -%}
{%- set mermaid_js = 'mermaid/mermaid.min.js' -%}
{%- endif -%}
{%-
set js_libs = {
@ -9,6 +12,7 @@
nprogress: nprogress_js,
iziToast: 'iziToast/iziToast.min.js',
iziModal: 'iziModal/iziModal.min.js',
mermaid: mermaid_js,
}
-%}

@ -1,11 +1,11 @@
{%- if theme.pjax.enable -%}
<script src="https://cdn.jsdelivr.net/npm/pjax/pjax.js"></script>
<script>
{%- if theme.pjax.enable -%}
window.pjax = new Pjax({
elements: 'a[href]:not([href^="#"]):not([href="javascript:void(0)"])',
selectors: ["head title, #main", "#footer"],
});
{%- endif -%}
/* 第一次载入页面加载的函数 */
pjax_ini = () => {
@ -21,12 +21,17 @@
{%- if theme.google_analytics -%}
pjax_google_analytics();
{%- endif -%}
{%- if theme.mermaid -%}
mermaid.init(undefined, $(".mermaid"));
{%-endif-%}
};
/* 第一次 执行 */
pjax_ini();
{%- if theme.pjax.enable -%}
{%- if theme.pjax.loadingbar -%}
{%- include "loading-bar.swig" -%}
{%- endif -%}
@ -59,5 +64,5 @@
});
</script>
{%- endif -%}
</script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save