%
if (page.sidebar == null) {
const root = theme.root
var sidebar
if (is_home()) {
sidebar = root.home.sidebar
} else if (is_category() || is_tag() || is_archive() || ['categories', 'tags', 'archives'].includes(page.layout)) {
sidebar = root.blog.sidebar
} else if (page.layout === 'index_topic' || page.layout === 'topic') {
sidebar = root.topic.sidebar
} else if (page.layout === 'index_wiki' || page.layout === 'wiki') {
sidebar = root.wiki.sidebar
} else if (page.layout === '404') {
sidebar = root.error_page.sidebar
} else if (page.layout === 'page') {
sidebar = root.page.sidebar
} else if (page.layout === 'post') {
sidebar = root.post.sidebar
} else if (page.layout == null) {
sidebar = root.page.sidebar
} else {
sidebar = []
}
if (page.layout === 'topic' && page.topic && theme.topic?.tree[page.topic]?.sidebar) {
sidebar = theme.topic.tree[page.topic].sidebar
}
if (page.layout == 'wiki' && page.wiki && theme.wiki?.tree[page.wiki]?.sidebar) {
sidebar = theme.wiki.tree[page.wiki].sidebar
}
page.sidebar = sidebar
}
// parse array string
if (typeof page.sidebar == 'string') {
page.sidebar = page.sidebar.replace(/ /g, '').split(',');
}
function layoutTitle(main, url, sub) {
var el = '';
el += '';
el += '