mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
fix: set theme during rendering
Sankey diagram isn't using yaml/directive currently
This commit is contained in:
parent
6960d63ee0
commit
eec16d3abe
1 changed files with 2 additions and 2 deletions
|
@ -277,7 +277,7 @@ function initMermaid( update, attrs ) {
|
||||||
}
|
}
|
||||||
var is_initialized = ( update ? update_func( attrs ) : init_func( attrs ) );
|
var is_initialized = ( update ? update_func( attrs ) : init_func( attrs ) );
|
||||||
if( is_initialized ){
|
if( is_initialized ){
|
||||||
mermaid.init();
|
mermaid.init({theme: attrs.theme});
|
||||||
// zoom for Mermaid
|
// zoom for Mermaid
|
||||||
// https://github.com/mermaid-js/mermaid/issues/1860#issuecomment-1345440607
|
// https://github.com/mermaid-js/mermaid/issues/1860#issuecomment-1345440607
|
||||||
var svgs = d3.selectAll( '.mermaid.zoom svg' );
|
var svgs = d3.selectAll( '.mermaid.zoom svg' );
|
||||||
|
@ -1347,7 +1347,7 @@ function useMermaid( config ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
||||||
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
||||||
if( config.theme && variants ){
|
if( config.theme && variants ){
|
||||||
var write_style = variants.findLoadedStylesheet( 'variant-style' );
|
var write_style = variants.findLoadedStylesheet( 'variant-style' );
|
||||||
write_style.setProperty( '--CONFIG-MERMAID-theme', config.theme );
|
write_style.setProperty( '--CONFIG-MERMAID-theme', config.theme );
|
||||||
|
|
Loading…
Reference in a new issue