https://github.com/peaceiris/hugo-mod-mermaidjs
mermaid-js/mermaid packaged as a Hugo Module.
https://github.com/peaceiris/hugo-mod-mermaidjs
hugo hugo-module hugo-theme mermaid mermaidjs
Last synced: 9 months ago
JSON representation
mermaid-js/mermaid packaged as a Hugo Module.
- Host: GitHub
- URL: https://github.com/peaceiris/hugo-mod-mermaidjs
- Owner: peaceiris
- License: mit
- Archived: true
- Created: 2020-10-06T03:41:50.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-02-10T10:41:25.000Z (over 4 years ago)
- Last Synced: 2024-11-15T12:30:41.884Z (over 1 year ago)
- Topics: hugo, hugo-module, hugo-theme, mermaid, mermaidjs
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## hugo-mod-mermaidjs
[mermaid-js/mermaid] packaged as a Hugo Module ([Hugo Modules]).
[mermaid-js/mermaid]: https://github.com/mermaid-js/mermaid
[Hugo Modules]: https://gohugo.io/hugo-modules
## Usage
To enable this module you must add the following parameters to your `config/_default/config.yaml`:
```yaml
module:
imports:
- path: github.com/peaceiris/hugo-mod-mermaidjs
```
If this is the first time you are using Hugo modules you need to prepare your setup by installing Go, initializing your modules and more. Please refer to the [official Hugo Documentation](https://gohugo.io/hugo-modules/use-modules/) to complete these steps.
In a Hugo template file.
```html
{{ $js := resources.Get "mod/mermaidjs/mermaid.min.js" }}
{{ $secureJS := $js | resources.Fingerprint "sha512" }}
var config = {
startOnLoad: true,
flowchart: {
useMaxWidth: true,
htmlLabels: true,
curve: "cardinal",
},
theme: "neutral",
securityLevel: "strict",
};
mermaid.initialize(config);
```