<% var banner = {} if (page.banner) { banner.url = page.banner } else if (theme.topic.tree[page.topic]?.banner != null) { banner.url = theme.topic.tree[page.topic]?.banner } else if (theme.wiki.tree[page.wiki]?.banner != null) { banner.url = theme.wiki.tree[page.wiki]?.banner } banner = Object.assign(banner, page.banner_info) // 标题 if (banner.title == null) { banner.title = page.h1 != null ? page.h1 : page.title } function layoutBreadcrumb() { if (page.breadcrumb === false) { return `
` } var el = '' // 1.main el += `
` // 2.left el += `
` // 3.left.top: 面包屑导航 el += `` // 3.left.bottom el += partial('dateinfo') // end 2.left el += `
` // end 1.main el += `
` return el } function layoutTitle() { if (banner.title?.length > 0) { return `

${banner.title}

` } else { return '' } } function layoutSubtitle() { if (banner.subtitle?.length > 0) { return `
${banner.subtitle}
` } else { return '' } } function layoutIcon() { if (banner.avatar?.length > 0 || banner.icon?.length > 0) { return `` } else { return '' } } function layoutBottom() { const el_icon = layoutIcon() const el_title = layoutTitle() const el_subtitle = layoutSubtitle() var cls = '' if (el_title.length > 0 && el_subtitle.length == 0) { cls += ' only-title' } if (el_title.length > 0) { return `
${el_icon}
${el_title} ${el_subtitle}
` } else { return `` } } function layoutDiv() { const bottom = layoutBottom() if (page.breadcrumb === false && bottom.length == 0) { return `` } const top = layoutBreadcrumb() var style = `` var el = `` el += `` return el } %> <%- layoutDiv() %>