From a8c0054e69055e508d2eb6837c2d3e87285205a9 Mon Sep 17 00:00:00 2001 From: XPoet Date: Thu, 7 Jan 2021 17:04:53 +0800 Subject: [PATCH] fix: fixed footer theme info display error --- layout/_partial/footer.ejs | 2 +- source/js/main.js | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs index 5483ecf..2c02c3d 100644 --- a/layout/_partial/footer.ejs +++ b/layout/_partial/footer.ejs @@ -23,7 +23,7 @@ <% } %>
- <%- __('powered_by', 'Hexo') %> | <%- __('theme') %> + <%- __('powered_by', 'Hexo') %> | <%- __('theme') %> Keep v<%= theme.version %>
diff --git a/source/js/main.js b/source/js/main.js index 778d1df..79d7503 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -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 = () => {