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

42 lines
1.3 KiB
Plaintext
Raw Normal View History

2021-02-21 03:13:21 +08:00
<%
2024-01-08 12:04:07 +08:00
const content = theme.footer.content?.replace('${author}', config.author)?.replace('${theme.name}', stellar_info('name'))?.replace('${theme.version}', stellar_info('version'))?.replace('${theme.tree}', stellar_info('tree'))
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">';
2022-09-14 17:47:08 +08:00
if (content) {
if ((typeof content == 'string') && content.constructor == String) {
el += markdown(content);
} else if ((typeof content == 'object') && content.constructor == Array) {
content.forEach((item, i) => {
2021-07-31 18:20:25 +08:00
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() %>