2021-06-26 15:02:32 +08:00
|
|
|
|
<%
|
2021-07-04 20:21:31 +08:00
|
|
|
|
var proj;
|
|
|
|
|
if (page.layout === 'wiki' && page.wiki) {
|
|
|
|
|
proj = theme.wiki.projects[page.wiki];
|
2021-06-26 15:02:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function layoutDiv() {
|
|
|
|
|
var el = '';
|
2021-07-04 20:21:31 +08:00
|
|
|
|
if (page.layout === 'wiki' && proj.index !== false) {
|
2021-06-26 15:02:32 +08:00
|
|
|
|
el += '<div class="logo-wrap wiki">';
|
|
|
|
|
// all products
|
|
|
|
|
el += '<a style="filter: grayscale(100%)" class="wiki-home cap" href="' + url_for(config.wiki_dir) + '">';
|
2021-07-03 20:49:52 +08:00
|
|
|
|
el += '<svg aria-hidden="true" viewBox="0 0 16 16" width="1rem" height="1rem" fill="currentColor"><path fill-rule="evenodd" d="M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"></path></svg>';
|
2021-06-26 15:02:32 +08:00
|
|
|
|
el += __('btn.all_wiki');
|
|
|
|
|
el += '</a>';
|
|
|
|
|
// this product
|
2021-07-04 20:21:31 +08:00
|
|
|
|
if (proj === undefined) {
|
|
|
|
|
// 如果没有项目名,则使用menu中显示的名字
|
2021-06-26 15:02:32 +08:00
|
|
|
|
if (page.menu_id && theme.sidebar.menu[page.menu_id] && md_link(theme.sidebar.menu[page.menu_id])) {
|
2021-07-04 20:21:31 +08:00
|
|
|
|
proj = {
|
|
|
|
|
path: md_link(theme.sidebar.menu[page.menu_id]),
|
|
|
|
|
wiki: __(md_text(theme.sidebar.menu[page.menu_id]))
|
|
|
|
|
};
|
2021-06-26 15:02:32 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-04 20:21:31 +08:00
|
|
|
|
if (proj !== undefined) {
|
|
|
|
|
el += '<a class="title" href="' + url_for(proj.path) + '">';
|
|
|
|
|
el += proj.title || proj.wiki;
|
2021-06-26 15:02:32 +08:00
|
|
|
|
el += '</a>';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
el += '<div class="logo-wrap">';
|
|
|
|
|
if (md_text(theme.sidebar.logo.avatar)) {
|
|
|
|
|
el += '<a class="avatar" href="' + url_for(md_link(theme.sidebar.logo.avatar) || "/") + '">';
|
2021-07-04 23:22:43 +08:00
|
|
|
|
if (theme.style.animated_avatar.animate) {
|
|
|
|
|
el += '<div class="bg" style="opacity:0;background-image:url(' + theme.style.animated_avatar.background + ');"></div>';
|
|
|
|
|
}
|
2021-06-26 15:02:32 +08:00
|
|
|
|
el += '<img no-lazy class="avatar" src="' + md_text(theme.sidebar.logo.avatar) + '">';
|
|
|
|
|
el += '</a>';
|
|
|
|
|
}
|
|
|
|
|
if (md_text(theme.sidebar.logo.title)) {
|
|
|
|
|
el += '<a class="title" href="' + url_for(md_link(theme.sidebar.logo.title) || "/") + '">';
|
2021-07-07 01:18:13 +08:00
|
|
|
|
el += '<div class="main">' + md_text(theme.sidebar.logo.title) + '</div>';
|
|
|
|
|
if (config.subtitle) {
|
|
|
|
|
let arr = config.subtitle.split('|');
|
|
|
|
|
if (arr.length > 0) {
|
|
|
|
|
el += '<div class="sub normal cap">' + arr[0] + '</div>';
|
|
|
|
|
if (arr.length > 1) {
|
|
|
|
|
el += '<div class="sub hover cap" style="opacity:0">' + arr[1] + '</div>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-26 15:02:32 +08:00
|
|
|
|
el += '</a>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
el += '</div>';
|
|
|
|
|
return el;
|
|
|
|
|
}
|
|
|
|
|
%>
|
|
|
|
|
|
2021-07-03 20:49:52 +08:00
|
|
|
|
<%- layoutDiv() %>
|