hexo-theme-stellar/layout/_plugins/mermaid.ejs

29 lines
719 B
Plaintext
Raw Permalink Normal View History

2024-02-12 23:07:56 +08:00
<script defer type="text/javascript" src="<%- conf.js %>"></script>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
var mermaid_config = {
startOnLoad: true,
theme:
"<%- theme.style.darkmode %>" == "auto" &&
window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark"
: "<%- conf.theme %>",
logLevel: 3,
themeVariables: {
darkMode: true
},
flowchart: {
useMaxWidth: false,
htmlLabels: true,
curve: "linear"
},
gantt: {
axisFormat: "%Y/%m/%d"
},
sequence: {
actorMargin: 50
}
}
mermaid.initialize(mermaid_config);
});
</script>