yufan.me/themes/spectre/layout/_plugin/highlight/hanabi.ejs
2024-06-14 02:15:18 +08:00

20 lines
864 B
Plaintext

<% if(theme.vendors.materialcdn) { %>
<%- jsLsload({path:(theme.vendors.materialcdn + '/js/hanabi-browser-bundle.js'),key:'hanabi'}) %>
<% } else { %>
<%- jsLsload({path:('js/hanabi-browser-bundle.js'),key:'hanabi'}) %>
<% } %>
<script type="text/ls-javascript" id="code-highlight-hanabi">
<% if (!theme.hanabi.includeDefaultColors) { %>
HanabiBrowser.clearColors();
<% } %>
<% if (theme.hanabi.customColors) { %>
<% if (typeof theme.hanabi.customColors === 'string') { %>
HanabiBrowser.putColor('<%= theme.hanabi.customColors %>');
<% } else { %>
<% theme.hanabi.customColors.forEach(function(elements) { %>
HanabiBrowser.putColor('<%= elements %>');
<% }); %>
<% } %>
<% } %>
HanabiBrowser.start('pre code',<%= theme.hanabi.line_number %>);
</script>