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

View File

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

View File

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