custom footer

This commit is contained in:
xaoxuu 2021-07-31 18:20:25 +08:00
parent ddd4c28c6b
commit 0d9ebb54c5
2 changed files with 11 additions and 0 deletions

View File

@ -157,6 +157,7 @@ footer:
# - '[GitLab](/)' # - '[GitLab](/)'
license: '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)' license: '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)' source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)'
more: # string or array (support markdown)
######## Tag Plugins ######## ######## Tag Plugins ########

View File

@ -2,6 +2,7 @@
const author = '[@' + config.author + '](' + config.url + config.root + ')'; const author = '[@' + config.author + '](' + config.url + config.root + ')';
const using = '[' + stellar_info('name') + '](' + stellar_info('tree') + ' "v' + stellar_info('version') + '")'; const using = '[' + stellar_info('name') + '](' + stellar_info('tree') + ' "v' + stellar_info('version') + '")';
const source = theme.footer.source; const source = theme.footer.source;
const more = theme.footer.more;
function layoutDiv() { function layoutDiv() {
var el = ''; var el = '';
el += '<footer class="page-footer reveal fs12">'; el += '<footer class="page-footer reveal fs12">';
@ -35,6 +36,15 @@ function layoutDiv() {
} else { } else {
el += markdown(__('footer.info_not_open_source', author, using)); el += markdown(__('footer.info_not_open_source', author, using));
} }
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);
});
}
}
el += '</div></footer>'; el += '</div></footer>';
return el; return el;
} }