44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
<%
|
|
function layoutWikiCover() {
|
|
if (page.layout != 'wiki') {
|
|
return '';
|
|
}
|
|
if (page.cover == undefined || page.cover == false || page.cover == '[]') {
|
|
return '';
|
|
}
|
|
var cover = page.cover;
|
|
if (page.cover == true) {
|
|
cover = ['logo', 'title', 'description'];
|
|
}
|
|
var el = '';
|
|
el += '<div class="l_cover' + scrollreveal() + '">';
|
|
el += '<article class="cover-wrap md">';
|
|
let proj = theme.wiki.projects[page.wiki];
|
|
if (proj.logo && proj.logo.src && cover.includes('logo')) {
|
|
el += '<div class="preview">';
|
|
if (proj.logo.large) {
|
|
el += '<img src="' + proj.logo.src + '" height="' + proj.logo.large + '">';
|
|
} else {
|
|
el += '<img src="' + proj.logo.src + '">';
|
|
}
|
|
el += '</div>';
|
|
}
|
|
if ((proj.title || page.title) && cover.includes('title')) {
|
|
el += '<div class="cover-title">';
|
|
el += '<span>' + (proj.title || page.title) + '</span>';
|
|
el += '</div>';
|
|
}
|
|
if ((proj.description || page.description) && cover.includes('description')) {
|
|
el += '<div class="description">' + (proj.description || page.description) + '</div>';
|
|
}
|
|
el += '<div class="start-wrap">';
|
|
el += '<a class="button theme start" href="#start">' + __('btn.getting_started') + '</a>';
|
|
el += '</div>';
|
|
el += '</article>';
|
|
el += '</div>';
|
|
el += '<hr>';
|
|
return el;
|
|
}
|
|
%>
|
|
<%- layoutWikiCover() %>
|