优化footer

This commit is contained in:
xaoxuu 2022-09-14 17:47:08 +08:00
parent 357e5484fa
commit 0a620199f1
3 changed files with 11 additions and 21 deletions

View File

@ -230,9 +230,10 @@ footer:
# '更多':
# - '[关于本站](/)'
# - '[GitHub](/)'
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)'
more: # string or array (support markdown)
content: | # 支持 Markdown 格式
本站由 [@anonymity](/) 使用 [Stellar](https://github.com/xaoxuu/hexo-theme-stellar) 主题创建。
本博客所有文章除特别声明外,均采用 [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) 许可协议,转载请注明出处。
# 主题用户越多,开发者维护和更新的积极性就越高,如果您喜欢本主题,请在适当的位置显示主题信息和仓库链接以表支持。
######## Tag Plugins ########

View File

@ -1,8 +1,5 @@
<%
const author = '[@' + config.author + '](' + config.url + config.root + ')';
const using = '[' + stellar_info('name') + '](' + stellar_info('tree') + ' "v' + stellar_info('version') + '")';
const source = theme.footer.source;
const more = theme.footer.more;
const content = theme.footer.content;
function layoutDiv() {
var el = '';
el += '<footer class="page-footer reveal fs12">';
@ -28,19 +25,11 @@ function layoutDiv() {
}
// footer
el += '<div class="text">';
if (theme.footer.license) {
el += markdown(__('footer.license', theme.footer.license));
}
if (source) {
el += markdown(__('footer.info_open_source', author, using, source));
} else {
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) => {
if (content) {
if ((typeof content == 'string') && content.constructor == String) {
el += markdown(content);
} else if ((typeof content == 'object') && content.constructor == Array) {
content.forEach((item, i) => {
el += markdown(item);
});
}

View File

@ -34,7 +34,7 @@
.page-footer .text
p
margin: 4px 0
line-height: 1.2
line-height: 1.5
a
text-decoration: underline
font-weight: 500