mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
cb9cec76e3
Mermaid diagrams can start with yaml front matter, e.g. ``` --- title: Example Diagram --- graph LR A --> B ``` Relearn injects an init directive `%%{init: {"theme":"default"}}%%` at the top of a mermaid block to support theming the mermaid diagram. However this will cause a syntax parser error in mermaid if the init directive comes before the yaml front matter. Valid: ``` %%{init: {"theme":"default"}}%% graph LR A --> B ``` Invalid: ``` %%{init: {"theme":"default"}}%% --- title: Example --- graph LR A --> B ``` To support yaml front matter, we detect if front matter is used, and inject the init directive after the front matter. ``` --- title: Example --- %%{init: {"theme":"default"}}%% graph LR A --> B ``` |
||
---|---|---|
.. | ||
css | ||
fonts | ||
images | ||
js | ||
webfonts |