refactor: adjust theme && theme user base info

This commit is contained in:
XPoet 2020-10-28 19:33:43 +08:00
parent a0f7170894
commit 7af399e98f
6 changed files with 25 additions and 13 deletions

View File

@ -1,12 +1,11 @@
# ---------------------------------------------------------------------------------------
# Theme basic info (please don't change)
# Your basic info
# ---------------------------------------------------------------------------------------
theme_info:
name: ILS
version: 2.1.1
base_info:
title: ILS
author: XPoet
repository: https://github.com/XPoet/hexo-theme-ils
email: i@xpoet.cn
url: https://ils.xpoet.cn/
# ---------------------------------------------------------------------------------------
# Theme style settings

View File

@ -1,7 +1,7 @@
<footer class="footer">
<div class="info-container">
<div class="copyright-info info-item">
&copy; <%= date(new Date(), 'YYYY') %> <i class="fa fa-heart-o"></i> <a href="/"><%= config.author %></a>
&copy; <%= date(new Date(), 'YYYY') %> <i class="fa fa-heart-o"></i> <a href="/"><%= theme.base_info.author || config.author || 'XPoet' %></a>
</div>
<% if (theme.website_count.busuanzi_count.enable) { %>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
@ -19,8 +19,7 @@
</div>
<% } %>
<div class="theme-info info-item">
<%- __('powered_by', '<a target="_blank" href="https://hexo.io">Hexo</a>') %> | <%- __('theme') %> <a
href="https://github.com/XPoet/hexo-theme-ils" target="_blank"><%= theme.theme_info.name %> v<%= theme.theme_info.version %></a>
<%- __('powered_by', '<a target="_blank" href="https://hexo.io">Hexo</a>') %> | <%- __('theme') %> <a class="theme-version" target="_blank"></a>
</div>
</div>
</footer>

View File

@ -22,7 +22,7 @@
<title>
<% if (title){ %><%= title %> |
<% } %>
<%= config.title %>
<%= theme.base_info.title || config.title || 'ILS' %>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<% if (theme.style.favicon){ %>

View File

@ -3,7 +3,7 @@
<div class="header-content">
<a class="logo-title" href="/">
<%= config.title %>
<%= theme.base_info.title || config.title || 'ILS' %>
</a>
<ul class="menu-list">

View File

@ -13,7 +13,6 @@ hexo.extend.helper.register('export_config', function () {
hostname: url.parse(config.url).hostname || config.url,
root: config.root,
localsearch: theme.local_search,
themeInfo: theme.theme_info,
codeblock: theme.codeblock,
toc: theme.toc,
back2top: theme.back2top

View File

@ -1,6 +1,21 @@
ILS.utils = {
themeInfo: {
author: 'XPoet',
name: 'ILS',
version: '2.1.2',
repository: 'https://github.com/XPoet/hexo-theme-ils'
},
printThemeInfo() {
console.log(`${CONFIG.themeInfo.name} v${CONFIG.themeInfo.version}`);
const themeInfo = `${this.themeInfo.name} v${this.themeInfo.version}`;
console.log(themeInfo);
const footThemeInfoDom = document.querySelector('.footer .info-container .theme-info a.theme-version');
if (footThemeInfoDom) {
footThemeInfoDom.setAttribute('href', this.themeInfo.repository);
footThemeInfoDom.innerHTML = themeInfo;
}
}
}