<% var logo = theme.logo if (page.logo) { logo = Object.assign({}, logo, page.logo) } else if (theme.wiki.tree[page.wiki]) { const proj = theme.wiki.tree[page.wiki] var l = proj.logo if (l) { logo = l } else if (proj.name || proj.icon) { logo = { icon: proj.icon || theme.default.project, title: `[${proj.name || proj.title}](${url_for(proj.homepage?.path || '')})`, subtitle: proj.subtitle } } } else if (theme.topic.tree[page.topic]) { const topic = theme.topic.tree[page.topic] var l = topic.logo if (l) { logo = l } else if (topic.name || topic.icon) { logo = { icon: topic.icon || theme.default.topic, title: `[${topic.name || topic.title}](${url_for(topic.homepage?.path || '')})`, subtitle: topic.subtitle } } } // logo.icon, logo.title, logo.subtitle, logo.url function layoutTitle(main, url, sub) { var el = '' el += `` el += `
${main}
` if (sub) { const arr = sub.split('|') if (arr.length > 1) { el += `
${arr.shift().trim()}
` el += `
${arr.join('|')}
` } else { el += `
${sub}
` } } el += `
` return el } function layoutDiv() { if (where == 'main') { if (page.header == false) { return '' } // 内容页如果未设置 header 则不显示 if (page.header == null) { if (!page.nav_tabs) { // 如果有 nav_tabs 就代表是列表页 if (page.layout === 'post' || page.layout === 'page' || page.wiki) { return '' } } } } var el = '' el += `
` el += `
` if (logo.icon) { el += `
` } else if (md_text(logo.avatar)) { el += `` if (theme.style.animated_avatar.animate) { el += `
` } el += `` el += `
` } const main = md_text(logo.title) if (main) { let url = md_link(logo.title) el += layoutTitle(main, url, logo.subtitle) } el += `
` el += '
' return el } %> <%- layoutDiv() %>