<% 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) { if (l.title.includes('](') == false) { l.title = `[${l.title}](${url_for(proj.homepage?.path || '')})` } 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 } } } // 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() %>