From 918f46c657cd2f5e14a0ea77174bf89f0eacb9aa Mon Sep 17 00:00:00 2001 From: leoli Date: Tue, 14 May 2024 17:32:31 +0800 Subject: [PATCH] added hugo module: mermaid --- exampleSite/config/_default/module.toml | 3 +++ exampleSite/config/_default/params.toml | 4 ++++ exampleSite/go.mod | 1 + layouts/partials/essentials/head.html | 3 +++ 4 files changed, 11 insertions(+) diff --git a/exampleSite/config/_default/module.toml b/exampleSite/config/_default/module.toml index 39ccf30..39cb6b4 100644 --- a/exampleSite/config/_default/module.toml +++ b/exampleSite/config/_default/module.toml @@ -94,3 +94,6 @@ path = "github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager" # [[imports]] # path = "github.com/gethugothemes/hugo-modules/seo-tools/counter-analytics" + +[[imports]] +path = "github.com/hugomods/mermaid" diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index c7786cd..0992553 100755 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -85,6 +85,10 @@ expire_days = 60 content = "This site uses cookies. By continuing to use this website, you agree to their use." button = "I Accept" +# diagrams +[mermaid] +js_url = 'https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.esm.min.mjs' + ######################## sidebar widgets ######################### [widgets] sidebar = ["categories", "tags"] diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 6879b04..3380dfb 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -26,4 +26,5 @@ require ( github.com/gethugothemes/hugo-modules/tab v0.0.0-20240504032439-79fc09d96848 // indirect github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20240504032439-79fc09d96848 // indirect github.com/gethugothemes/hugo-modules/videos v0.0.0-20240504032439-79fc09d96848 // indirect + github.com/hugomods/mermaid v0.1.1 // indirect ) diff --git a/layouts/partials/essentials/head.html b/layouts/partials/essentials/head.html index a14796b..bb7b1a7 100755 --- a/layouts/partials/essentials/head.html +++ b/layouts/partials/essentials/head.html @@ -56,3 +56,6 @@ {{/* {{ partialCached "crisp-chat.html" . }} */}} + + +{{ partial "mermaid/assets/js" . }}