mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 20:09:41 +08:00
优化:优化页脚版权时间显示
This commit is contained in:
parent
010b4559e5
commit
a6093ce9e7
@ -408,6 +408,23 @@ const commonContext = {
|
||||
websiteDate.innerHTML = `建站<span class="stand">${days}</span>天<span class="stand">${hours}</span>时<span class="stand">${minutes}</span>分<span class="stand">${seconds}</span>秒`
|
||||
}, 1000)
|
||||
},
|
||||
/* 显示web版权 */
|
||||
webCopyright() {
|
||||
if (!DreamConfig.website_time) {
|
||||
return
|
||||
}
|
||||
const webCopyright = document.getElementById('webCopyright')
|
||||
const now = new Date()
|
||||
let nowYear = now.getFullYear()
|
||||
const grt = new Date(DreamConfig.website_time)
|
||||
let getYear = grt.getFullYear()
|
||||
if(nowYear === getYear) {
|
||||
webCopyright.innerText = '© '+nowYear+' '+ DreamConfig.site_title
|
||||
return
|
||||
}
|
||||
|
||||
webCopyright.innerText = '© '+getYear + '-'+nowYear+' '+ DreamConfig.site_title
|
||||
},
|
||||
/* 初始化评论区 */
|
||||
initComment() {
|
||||
if (!window.CommentWidget) {
|
||||
@ -455,7 +472,7 @@ const commonContext = {
|
||||
window.commonContext = commonContext
|
||||
|
||||
!(function () {
|
||||
const loads = ['initCarousel', 'sparkInput', 'websiteTime', 'initComment']
|
||||
const loads = ['initCarousel', 'sparkInput', 'websiteTime', 'initComment', 'webCopyright']
|
||||
const omits = ['initEffects', 'loadMaintain', 'showThemeVersion']
|
||||
|
||||
Object.keys(commonContext).forEach(
|
||||
|
@ -70,6 +70,8 @@
|
||||
});'})]
|
||||
/** 主题配置 */
|
||||
const DreamConfig = {};
|
||||
/** 站点名 */
|
||||
DreamConfig["site_title"] = [[${site.title}]];
|
||||
/** 配置分享方式 */
|
||||
let post_share = []
|
||||
for (let share of [[${theme.config.post.custom_post_share}]]) {
|
||||
|
@ -12,11 +12,11 @@
|
||||
</li>
|
||||
<li>
|
||||
<p class="icon-spot">
|
||||
<span th:text="'© '+${#dates.format(#dates.createNow(), 'yyyy')}+' '+ ${site.title}"></span><a
|
||||
<span id="webCopyright" th:text="'© '+${#dates.format(#dates.createNow(), 'yyyy')}+' '+ ${site.title}"></span><a
|
||||
th:if="${!#strings.isEmpty(theme.config.basic_info.record_number)}"
|
||||
href="http://beian.miit.gov.cn/publish/query/indexFirst.action" target="_blank" rel="noopener noreferrer nofollow"
|
||||
th:text="${theme.config.basic_info.record_number}"></a><span class="footer-truncation">Powered by <a class="powered" href="https://halo.run/" target="_blank">Halo</a> & <a class="powered" href="https://github.com/nineya/halo-theme-dream2.0" target="_blank">Dream</a></span></p>
|
||||
<p class="icon-spot" th:if="${!#strings.isEmpty(theme.config.basic_info.website_time) || theme.config.enhance.enable_busuanzi}">
|
||||
<p class="icon-spot" th:if="${!#strings.isEmpty(theme.config.basic_info.website_time) || theme.config.enhance.enable_busuanzi == true}">
|
||||
<span th:if="${!#strings.isEmpty(theme.config.basic_info.website_time)}" id="websiteDate">建站<span class="stand">00</span>天<span class="stand">0</span>时<span class="stand">0</span>分<span class="stand">0</span>秒</span>
|
||||
<span th:if="${theme.config.enhance.enable_busuanzi == true}" class="icon-spot footer-truncation">
|
||||
<span id="busuanzi_container_site_uv" style="display: none">
|
||||
|
Loading…
x
Reference in New Issue
Block a user