<% // 默认组件 if (page.sidebar == undefined) { if (page.layout == 'post' && page.content) { page.sidebar = ['toc', 'recent']; } else if (page.layout == 'wiki' && page.content) { page.sidebar = ['toc', 'wiki_more']; } else { page.sidebar = theme.sidebar.widgets.layout; } } function layoutFooterDiv() { if (theme.footer.social && theme.footer.social.length > 0) { var el = ''; return el; } else { return ''; } } %>
<%- partial('header') %>
<% page.sidebar.forEach(function(widget){ %> <% if (widget in theme.sidebar.widgets) { %> <% let w = theme.sidebar.widgets[widget]; %> <%- partial('widgets/' + w.layout, {item: w}) %> <% } %> <% }) %>
<%- layoutFooterDiv() %>