mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-07-16 12:22:27 +00:00
mermaid: header is showing up in FF #311
This commit is contained in:
parent
4a50b27d65
commit
8f6e091a65
2 changed files with 26 additions and 18 deletions
static/js
|
@ -894,3 +894,26 @@ jQuery.fn.highlight = function(words, options) {
|
|||
jQuery.highlight(this, re, settings.element, settings.className);
|
||||
});
|
||||
};
|
||||
|
||||
function useMermaid( config ){
|
||||
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
||||
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
||||
if( config.theme && variants ){
|
||||
var write_style = variants.findLoadedStylesheet( 'variant-style' );
|
||||
write_style.setProperty( '--CONFIG-MERMAID-theme', config.theme );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( themeUseMermaid ){
|
||||
useMermaid( themeUseMermaid );
|
||||
}
|
||||
|
||||
function useSwagger( config ){
|
||||
if( config.theme && variants ){
|
||||
var write_style = variants.findLoadedStylesheet( 'variant-style' );
|
||||
write_style.setProperty( '--CONFIG-SWAGGER-theme', config.theme );
|
||||
}
|
||||
}
|
||||
if( themeUseSwagger ){
|
||||
useSwagger( themeUseSwagger );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue