<%- js_ex(theme.static_prefix.jquery, 'jquery.min.js') %>
<%- js_ex(theme.static_prefix.bootstrap, 'js/bootstrap.min.js') %>
<%- js_ex(theme.static_prefix.internal_js, 'debouncer.js') %>
<%- js_ex(theme.static_prefix.internal_js, 'main.js') %>

<!-- Plugins -->

<% if (theme.lazyload.enable){ %>
  <% if (theme.lazyload.onlypost) { %>
    <% if (is_post() || is_page()) { %>
      <%- js_ex(theme.static_prefix.internal_js, 'lazyload.js') %>
    <% } %>
  <% } else { %>
    <%- js_ex(theme.static_prefix.internal_js, 'lazyload.js') %>
  <% }%>
<% } %>

<% if (theme.highlight.copy_btn) { %>
  <%- js_ex(theme.static_prefix.clipboard, 'clipboard.min.js', 'defer') %>
  <%- js_ex(theme.static_prefix.internal_js, 'clipboard-use.js') %>
<% } %>

<% if ((theme.footer.statistics.enable && theme.footer.statistics.source === 'busuanzi')
  || (page.meta !== false && theme.post.meta.views.enable && theme.post.meta.views.source === 'busuanzi')) { %>
  <%- js_ex(theme.static_prefix.busuanzi, 'busuanzi.pure.mini.js', 'defer') %>
<% } else if ( theme.web_analytics.leancloud.app_id && theme.web_analytics.leancloud.app_key &&
  ((theme.footer.statistics.enable && theme.footer.statistics.source === 'leancloud')
    || (page.meta !== false && theme.post.meta.views.enable && theme.post.meta.views.source === 'leancloud'))) { %>
  <%- partial('_partial/plugins/leancloud.ejs') %>
<% } else if (theme.web_analytics.enable && theme.web_analytics.leancloud.app_id && theme.web_analytics.leancloud.app_key) { %>
  <%- partial('_partial/plugins/leancloud.ejs') %>
<% } %>

<% if (theme.custom_js) { %>
  <%- js(theme.custom_js) %>
<% } %>

<%- partial('_partial/plugins/tocjs.ejs') %>
<%- partial('_partial/plugins/typed.ejs') %>
<%- partial('_partial/plugins/anchor.ejs') %>
<%- partial('_partial/plugins/local-search.ejs') %>
<%- partial('_partial/plugins/fancybox.ejs') %>
<%- partial('_partial/plugins/math.ejs') %>
<%- partial('_partial/plugins/mouse-click.ejs') %>
<%- partial('_partial/plugins/daovoice.ejs') %>
<%- partial('_partial/plugins/mermaid.ejs') %>
<%- partial('_partial/plugins/analytics.ejs') %>
