mirror of
https://github.com/Vimux/Binario.git
synced 2025-04-22 05:09:05 +00:00
feat: add mermaidjs support
This commit is contained in:
parent
3b825c1469
commit
c6e3868249
4 changed files with 18 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
* Table of contents
|
||||
* Related content
|
||||
* MathJax
|
||||
* Mermaid
|
||||
|
||||
## Table of Contents
|
||||
|
||||
|
@ -151,6 +152,8 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id
|
|||
mathjax = true # Enable MathJax for all site pages
|
||||
mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js" # Specify MathJax path. Optional
|
||||
mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional
|
||||
mermaid = true # Enable MathJax for all site pages
|
||||
mermaidPath = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js" # Specify mermaid path. Optional
|
||||
hideNoPostsWarning = false # Don't show no posts empty state warning in main page, if true
|
||||
|
||||
[Params.Entry]
|
||||
|
@ -243,6 +246,7 @@ authorbox: true # Enable/disable Authorbox for specific page
|
|||
toc: true # Enable/disable Table of Contents for specific page
|
||||
tocOpen: true # Open Table of Contents block for specific page
|
||||
mathjax: true # Enable/disable MathJax for specific page
|
||||
mermaid: true # Enable/disable mermaid for specific page
|
||||
related: true # Enable/disable Related content for specific page
|
||||
meta:
|
||||
- date
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
<script src="{{ "js/menu.js" | relURL }}"></script>
|
||||
{{- end }}
|
||||
{{- partial "mathjax.html" . -}}
|
||||
{{- partial "mermaid.html" . -}}
|
||||
{{- range .Site.Params.customJS }}
|
||||
<script src="{{ . | relURL }}"></script>
|
||||
{{- end }}
|
||||
|
|
3
layouts/partials/mermaid.html
Normal file
3
layouts/partials/mermaid.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ if and .IsPage (eq (.Param "mermaid") true) }}
|
||||
<script src={{ .Param "mermaidPath" | default "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js" }} async></script>
|
||||
{{ end }}
|
10
layouts/shortcodes/mermaid.html
Normal file
10
layouts/shortcodes/mermaid.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<div class="mermaid">
|
||||
{{ if .Get "theme" }}
|
||||
%%{init: {'theme': '{{.Get "theme"}}'}}%%
|
||||
{{ else if .Get "configuration" }}
|
||||
%%{{.Get "configuration"}}%%
|
||||
{{ else }}
|
||||
%%{init: {'theme': 'dark', 'themeVariables': { 'nodeBorder': '#9ccc6c'}}}%%
|
||||
{{ end }}
|
||||
{{.Inner}}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue