fix: fixed footer theme info display error
This commit is contained in:
parent
182868292a
commit
a8c0054e69
|
@ -23,7 +23,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class="theme-info info-item">
|
<div class="theme-info info-item">
|
||||||
<%- __('powered_by', '<a target="_blank" href="https://hexo.io">Hexo</a>') %> | <%- __('theme') %> <a class="theme-version" target="_blank"></a>
|
<%- __('powered_by', '<a target="_blank" href="https://hexo.io">Hexo</a>') %> | <%- __('theme') %> <a class="theme-version" target="_blank" href="https://github.com/XPoet/hexo-theme-keep">Keep v<%= theme.version %></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -1,21 +1,14 @@
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
KEEP.themeInfo = {
|
KEEP.themeInfo = {
|
||||||
|
theme: `Keep v${KEEP.theme_config.version}`,
|
||||||
author: 'XPoet',
|
author: 'XPoet',
|
||||||
name: 'Keep',
|
|
||||||
version: KEEP.theme_config.version,
|
|
||||||
repository: 'https://github.com/XPoet/hexo-theme-keep'
|
repository: 'https://github.com/XPoet/hexo-theme-keep'
|
||||||
}
|
}
|
||||||
|
|
||||||
// print theme base info
|
// print theme base info
|
||||||
KEEP.printThemeInfo = () => {
|
KEEP.printThemeInfo = () => {
|
||||||
const themeInfo = `${KEEP.themeInfo.name} v${KEEP.themeInfo.version}`;
|
console.log(`\n %c ${KEEP.themeInfo.theme} %c ${KEEP.themeInfo.repository} \n`, `color: #fadfa3; background: #333; padding: 5px 0;`, `background: #fadfa3; padding: 5px 0;`);
|
||||||
console.log(`\n %c ${themeInfo} %c ${KEEP.themeInfo.repository} \n`, `color: #fadfa3; background: #333; padding: 5px 0;`, `background: #fadfa3; padding: 5px 0;`);
|
|
||||||
const footThemeInfoDom = document.querySelector('.footer .info-container .theme-info a.theme-version');
|
|
||||||
if (footThemeInfoDom) {
|
|
||||||
footThemeInfoDom.setAttribute('href', KEEP.themeInfo.repository);
|
|
||||||
footThemeInfoDom.innerHTML = themeInfo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
KEEP.refresh = () => {
|
KEEP.refresh = () => {
|
||||||
|
|
Loading…
Reference in New Issue