mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-05-22 09:44:10 +00:00
deploy: 9f15ea397d
This commit is contained in:
parent
c7607e6227
commit
7afc0c1108
320 changed files with 9010 additions and 9022 deletions
js
27
js/theme.js
27
js/theme.js
|
@ -894,3 +894,30 @@ jQuery.fn.highlight = function(words, options) {
|
|||
jQuery.highlight(this, re, settings.element, settings.className);
|
||||
});
|
||||
};
|
||||
|
||||
function useMermaid( config ){
|
||||
if( !Object.assign ){
|
||||
// We don't support Mermaid for IE11 anyways, so bail out early
|
||||
return;
|
||||
}
|
||||
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( window.themeUseMermaid ){
|
||||
useMermaid( window.themeUseMermaid );
|
||||
}
|
||||
|
||||
function useSwagger( config ){
|
||||
if( config.theme && variants ){
|
||||
var write_style = variants.findLoadedStylesheet( 'variant-style' );
|
||||
write_style.setProperty( '--CONFIG-SWAGGER-theme', config.theme );
|
||||
}
|
||||
}
|
||||
if( window.themeUseSwagger ){
|
||||
useSwagger( window.themeUseSwagger );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue