refactor: adjust theme && theme user base info
This commit is contained in:
parent
a0f7170894
commit
7af399e98f
11
_config.yml
11
_config.yml
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<footer class="footer">
|
||||
<div class="info-container">
|
||||
<div class="copyright-info info-item">
|
||||
© <%= date(new Date(), 'YYYY') %> <i class="fa fa-heart-o"></i> <a href="/"><%= config.author %></a>
|
||||
© <%= 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>
|
||||
|
|
|
@ -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){ %>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue