mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🔧 Chore(i): Mermaid ZenUML is not enabled by default
This commit is contained in:
+4
-4
@@ -649,8 +649,8 @@ class FixIt {
|
||||
});
|
||||
await window.mermaid.run();
|
||||
processing = false;
|
||||
if (delayTask && delayTask instanceof Function) {
|
||||
delayTask()
|
||||
if (delayTask && typeof delayTask === 'function') {
|
||||
await delayTask();
|
||||
delayTask = null;
|
||||
}
|
||||
};
|
||||
@@ -660,7 +660,7 @@ class FixIt {
|
||||
el.replaceChild(el.nextElementSibling.content.cloneNode(true), el.firstChild);
|
||||
el.removeAttribute('data-processed');
|
||||
});
|
||||
loadMermaid()
|
||||
await loadMermaid();
|
||||
};
|
||||
|
||||
this.switchThemeEventSet.add(() => {
|
||||
@@ -670,7 +670,7 @@ class FixIt {
|
||||
return;
|
||||
}
|
||||
// console.log('reload immediately');
|
||||
reloadMermaid();
|
||||
reloadMermaid().catch(console.error);
|
||||
});
|
||||
|
||||
this.beforeprintEventSet.add(() => {
|
||||
|
||||
@@ -702,9 +702,12 @@ mainSections = []
|
||||
# See https://github.com/mermaid-js/mermaid
|
||||
[params.mermaid]
|
||||
# FixIt 0.4.0 | NEW Mermaid ESM module CDN source
|
||||
cdn = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs"
|
||||
# default is https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs
|
||||
cdn = ""
|
||||
# FixIt 0.4.0 | NEW ZenUML ESM module CDN source
|
||||
zenuml = "https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-zenuml/dist/mermaid-zenuml.esm.min.mjs"
|
||||
# default is empty, you can set it to a CDN source to enable ZenUML support
|
||||
# e.g. https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-zenuml/dist/mermaid-zenuml.esm.min.mjs
|
||||
zenuml = ""
|
||||
# For values, see https://mermaid.js.org/config/theming.html#available-themes
|
||||
themes = ["default", "dark"]
|
||||
|
||||
|
||||
@@ -131,7 +131,12 @@
|
||||
{{- /* mermaid */ -}}
|
||||
{{- if .Store.Get "hasMermaid" -}}
|
||||
{{- $mermaid := .Param "mermaid" -}}
|
||||
{{- $content := printf "import mermaid from %q; import zenuml from %q; await mermaid.registerExternalDiagrams([zenuml]); window.mermaid = mermaid;" $mermaid.cdn $mermaid.zenuml -}}
|
||||
{{- $mermaidCDN := $mermaid.cdn | default "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs" -}}
|
||||
{{- $content := printf "import mermaid from %q;" $mermaidCDN -}}
|
||||
{{- with $mermaid.zenuml -}}
|
||||
{{- $content = printf "%v import zenuml from %q; await mermaid.registerExternalDiagrams([zenuml]);" $content . -}}
|
||||
{{- end -}}
|
||||
{{- $content = printf "%v window.mermaid = mermaid;" $content -}}
|
||||
{{- dict "Content" $content "Attr" `type="module"` | dict "Page" $ "Data" | partial "store/script.html" -}}
|
||||
{{- $config = dict "themes" $mermaid.themes | dict "mermaid" | merge $config -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v0.4.0-alpha-20250812094854-45f101a4" -}}
|
||||
{{- hugo.Store.Set "version" "v0.4.0-alpha-20250813022026-bf3fe683" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user