%
function layoutDiv() {
var el = '';
var item = [];
if (page.references?.length > 0) {
item.push('references');
}
if (theme.article.license?.length > 0) {
item.push('license');
}
if (theme.article.share?.length > 0) {
item.push('share');
}
if (item.length === 0) {
return el;
}
el += '
';
if (page.references?.length > 0) {
function refList() {
var el = '';
page.references.forEach((item, i) => {
el += '
';
el += '';
} else {
el += ' rel="noopener noreferrer">';
}
el += item.title || item.url;
el += ' ';
el += ' ';
});
return el;
}
el += `
`
}
var license = ''
if (page.layout == 'post') {
if (theme.article.license && (page.license != false)) {
license = markdown(page.license || theme.article.license)
}
} else if (page.layout == 'wiki' && page.wiki) {
let proj = theme.wiki.tree[page.wiki]
if (page.license != null) {
license = markdown(page.license || theme.article.license)
} else if (proj?.license != null) {
license = markdown(proj.license || theme.article.license)
}
}
if (license.length > 0) {
el += `
`
}
var showSharePlugin = false
if (page.layout == 'post') {
showSharePlugin = page.share != false
} else if (page.layout == 'wiki' && page.wiki) {
let proj = theme.wiki.tree[page.wiki]
if (page.share != null) {
showSharePlugin = page.share == true
} else if (proj != null) {
showSharePlugin = proj.share == true
}
}
if (theme.article.share && showSharePlugin) {
function socialButtons() {
var el = ''
theme.article.share.forEach((item, i) => {
if (['wechat', 'weibo', 'email', 'link'].includes(item)) {
el += '
';
if (item == 'wechat') {
el += ' ';
} else if (item == 'weibo') {
el += ' ';
} else if (item == 'email') {
el += ' ';
} else if (item == 'link') {
el += ' ';
}
el += ' ';
}
});
return el;
}
function qrcode() {
if (theme.article.share.includes('wechat')) {
return `
`
} else {
return ''
}
}
el += `
${socialButtons()}
${qrcode()}
`
}
el += '
';
return el;
}
%>
<%- layoutDiv(); %>