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