% var logo = theme.logo if (page.logo) { logo = Object.assign({}, logo, page.logo) } else if (page.wiki && page.layout == 'wiki' && 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 (page.topic && page.layout == 'topic' && 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.layout == 'wiki' && page.menu_id == 'wiki') { return '' } if (page.header == false) { 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() %>