diff --git a/_config.yml b/_config.yml index 806eb21cee..b6c2952b14 100644 --- a/_config.yml +++ b/_config.yml @@ -853,6 +853,16 @@ pdf: # CDNJS, provided by cloudflare, maybe the best CDN, but not works in China #cdn: //cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js +# Mermaid tag +mermaid: + enable: false + # Available themes: default | dark | forest | neutral + theme: forest + # Use 8.0.0 as default, jsdelivr as default CDN, works everywhere even in China + cdn: //cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js + # CDNJS, provided by cloudflare, maybe the best CDN, but not works in China + #cdn: //cdnjs.cloudflare.com/ajax/libs/mermaid/8.0.0/mermaid.min.js + #! --------------------------------------------------------------- #! DO NOT EDIT THE FOLLOWING SETTINGS @@ -879,16 +889,16 @@ motion: sidebar: slideUpIn # Fancybox. There is support for old version 2 and new version 3. -# Choose only any one variant, do not need to install both. +# Choose only one variant, do not need to install both. # To install 2.x: https://github.com/theme-next/theme-next-fancybox # To install 3.x: https://github.com/theme-next/theme-next-fancybox3 fancybox: false -# Added switch option for separated repo in 6.0.0. +# Polyfill to remove click delays on browsers with touch UIs. # Dependencies: https://github.com/theme-next/theme-next-fastclick fastclick: false -# Added switch option for separated repo in 6.0.0. +# Vanilla JavaScript plugin for lazyloading images. # Dependencies: https://github.com/theme-next/theme-next-jquery-lazyload lazyload: false diff --git a/layout/_layout.swig b/layout/_layout.swig index f388169203..a273ee9cdf 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -110,6 +110,7 @@ {% include '_third-party/analytics/firestore.swig' %} {% include '_third-party/math/index.swig' %} {% include '_third-party/pdf.swig' %} + {% include '_third-party/mermaid.swig' %} {% include '_third-party/baidu-push.swig' %} {% include '_third-party/schedule.swig' %} {% include '_third-party/needsharebutton.swig' %} diff --git a/layout/_third-party/mermaid.swig b/layout/_third-party/mermaid.swig new file mode 100644 index 0000000000..a7859a6d4f --- /dev/null +++ b/layout/_third-party/mermaid.swig @@ -0,0 +1,21 @@ +{% if theme.mermaid.enable %} + +{% endif %} diff --git a/scripts/tags/mermaid.js b/scripts/tags/mermaid.js new file mode 100644 index 0000000000..7b5aae6a6c --- /dev/null +++ b/scripts/tags/mermaid.js @@ -0,0 +1,16 @@ +/** + * mermaid.js | https://theme-next.org/docs/tag-plugins/mermaid/ + */ + +/* global hexo */ + +'use strict'; + +function mermaid(args, content) { + return `
+ ${args.join(' ')} + ${content} +`; +} + +hexo.extend.tag.register('mermaid', mermaid, {ends: true}); diff --git a/source/js/src/js.cookie.js b/source/js/src/js.cookie.js index c6c3975831..97b4fea1de 100644 --- a/source/js/src/js.cookie.js +++ b/source/js/src/js.cookie.js @@ -5,6 +5,7 @@ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license */ + ;(function (factory) { var registeredInModuleLoader = false; if (typeof define === 'function' && define.amd) {