hexo-theme-keep/layout/_partial/scripts.ejs

45 lines
987 B
Plaintext

<%- __js([
'js/utils.js',
'js/main.js',
'js/header-shrink.js',
'js/back2top.js',
'js/dark-light-toggle.js'
]) %>
<%
const {
local_search: t_local_search,
code_copy: t_code_copy,
code_block_tools: t_code_block_tools,
lazyload: t_lazyload,
toc: t_toc,
pjax: t_pjax
} = theme
%>
<% if (t_local_search?.enable === true) { %>
<%- __js('js/local-search.js') %>
<% } %>
<% if (t_code_block_tools?.enable === true || t_code_copy?.enable === true) { %>
<%- __js('js/code-block-tools.js') %>
<% } %>
<% if (t_lazyload?.enable === true) { %>
<%- __js('js/lazyload.js') %>
<% } %>
<div class="post-scripts<%= theme.pjax?.enable === true ? ' pjax' : '' %>">
<% if (t_toc?.enable === true && is_post()) { %>
<%- __js([
'js/left-side-toggle.js',
'js/libs/anime.min.js',
'js/toc.js'
]) %>
<% } %>
</div>
<% if (t_pjax?.enable === true) { %>
<%- partial('pjax/pjax') %>
<% } %>