Skip to content

Commit

Permalink
fix: fixed footer theme info display error
Browse files Browse the repository at this point in the history
  • Loading branch information
XPoet committed Jan 7, 2021
1 parent 1828682 commit a8c0054
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>
<% } %>
<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>
</footer>
11 changes: 2 additions & 9 deletions source/js/main.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
window.addEventListener('DOMContentLoaded', () => {

KEEP.themeInfo = {
theme: `Keep v${KEEP.theme_config.version}`,
author: 'XPoet',
name: 'Keep',
version: KEEP.theme_config.version,
repository: 'https://github.com/XPoet/hexo-theme-keep'
}

// print theme base info
KEEP.printThemeInfo = () => {
const themeInfo = `${KEEP.themeInfo.name} v${KEEP.themeInfo.version}`;
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;
}
console.log(`\n %c ${KEEP.themeInfo.theme} %c ${KEEP.themeInfo.repository} \n`, `color: #fadfa3; background: #333; padding: 5px 0;`, `background: #fadfa3; padding: 5px 0;`);
}

KEEP.refresh = () => {
Expand Down

0 comments on commit a8c0054

Please sign in to comment.