hexo-theme-stellar/layout/_partial/main/footer.ejs

53 lines
1.6 KiB
Plaintext
Raw Normal View History

2021-02-21 03:13:21 +08:00
<%
2021-02-21 18:48:38 +08:00
const author = '[@' + config.author + '](' + config.url + config.root + ')';
2021-07-24 00:47:13 +08:00
const using = '[' + stellar_info('name') + '](' + stellar_info('tree') + ' "v' + stellar_info('version') + '")';
2021-02-21 03:13:21 +08:00
const source = theme.footer.source;
2021-07-31 18:20:25 +08:00
const more = theme.footer.more;
2021-02-21 03:13:21 +08:00
function layoutDiv() {
2021-06-26 16:08:16 +08:00
var el = '';
2021-07-13 22:25:24 +08:00
el += '<footer class="page-footer reveal fs12">';
2021-06-26 16:08:16 +08:00
el += '<hr>';
// sitemap
if (theme.footer.sitemap && Object.keys(theme.footer.sitemap).length > 0) {
el += '<div class="sitemap">';
for (let group of Object.keys(theme.footer.sitemap)) {
let items = theme.footer.sitemap[group];
if (items == undefined || items.length == 0) {
continue;
}
el += '<div class="sitemap-group">';
el += '<span class="fs14">' + group + '</span>';
items.forEach((item, i) => {
el += '<a href="' + url_for(md_link(item)) + '">';
el += __(md_text(item));
el += '</a>';
});
el += '</div>';
}
el += '</div>';
}
// footer
el += '<div class="text">';
2021-02-21 03:13:21 +08:00
if (theme.footer.license) {
2021-06-26 16:08:16 +08:00
el += markdown(__('footer.license', theme.footer.license));
2021-02-21 03:13:21 +08:00
}
if (source) {
2021-06-26 16:08:16 +08:00
el += markdown(__('footer.info_open_source', author, using, source));
2021-02-21 03:13:21 +08:00
} else {
2021-06-26 16:08:16 +08:00
el += markdown(__('footer.info_not_open_source', author, using));
2021-02-21 03:13:21 +08:00
}
2021-07-31 18:20:25 +08:00
if (more) {
if ((typeof more == 'string') && more.constructor == String) {
el += markdown(more);
} else if ((typeof more == 'object') && more.constructor == Array) {
more.forEach((item, i) => {
el += markdown(item);
});
}
}
2021-06-26 16:08:16 +08:00
el += '</div></footer>';
return el;
2021-02-21 03:13:21 +08:00
}
%>
<%- layoutDiv() %>