Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以支持 mermaid 嘛? #539

Open
domeniczz opened this issue Nov 30, 2022 · 1 comment
Open

可以支持 mermaid 嘛? #539

domeniczz opened this issue Nov 30, 2022 · 1 comment

Comments

@domeniczz
Copy link

我根据网上教程,安装了 hexo-filter-mermaid-diagrams

该项目的 readme 中写,需要在主题的 after_footer.pug 中添加

if theme.mermaid.enable == true
  script(type='text/javascript', id='maid-script' mermaidoptioins=theme.mermaid.options src='https://unpkg.com/mermaid@'+ theme.mermaid.version + '/dist/mermaid.min.js' + '?v=' + theme.version)
  script.
    if (window.mermaid) {
      var options = JSON.parse(document.getElementById('maid-script').getAttribute('mermaidoptioins'));
      mermaid.initialize(options);
    }

但我们的主题中没有 after_footer.pug,所以,我自己新建了该文件,并把以上代码粘贴进去

但是没有效果,mermaid 还是无法被渲染

请问有什么解决方案嘛,万分感谢!!!!!!!

@cirry
Copy link

cirry commented Apr 23, 2023

主题的文件位置在themes/maupassant/layout/_partial/after_footer.pug
根据文档,先装包,后配置,亲测可以使用。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants