mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:40:55 +08:00
feat: 增加 aside 最新評論部件
style: 部分css調整和html優化 improvements: 刪除pwa中的theme-color配置,默認生成meta theme-color close #340 improvements: 優化最後更新時間顯示(1小時內顯示 剛剛,1小時到24小時 顯示 xx小時前,1天到365天 顯示 xx天前,365天后直接顯示日期)
This commit is contained in:
@@ -618,9 +618,9 @@ const addCopyright = () => {
|
||||
* 網頁運行時間
|
||||
*/
|
||||
const addRuntime = () => {
|
||||
const $runtimeCount = $('#webinfo-runtime-count')
|
||||
const $runtimeCount = $('#runtimeshow')
|
||||
if ($runtimeCount.length) {
|
||||
const publishDate = $runtimeCount.attr('publish_date')
|
||||
const publishDate = $runtimeCount.attr('data-publishDate')
|
||||
$runtimeCount.text(diffDate(publishDate) + ' ' + GLOBAL_CONFIG.runtime)
|
||||
}
|
||||
}
|
||||
@@ -629,17 +629,12 @@ const addRuntime = () => {
|
||||
* 最後一次更新時間
|
||||
*/
|
||||
const addLastPushDate = () => {
|
||||
const $lastPushDateItem = $('.webinfo-last-push-date')
|
||||
const $lastPushDateItem = $('#last-push-date')
|
||||
if ($lastPushDateItem.length) {
|
||||
const lastPushDate = $lastPushDateItem.attr('last-push-date')
|
||||
const diffDay = diffDate(lastPushDate)
|
||||
if (diffDay < 1) {
|
||||
$lastPushDateItem.text(GLOBAL_CONFIG.last_push_date.zeroDay)
|
||||
} else if (diffDay > 365) {
|
||||
$lastPushDateItem.text(lastPushDate)
|
||||
} else {
|
||||
$lastPushDateItem.text(diffDay + ' ' + GLOBAL_CONFIG.last_push_date.suffix)
|
||||
}
|
||||
const lastPushDate = $lastPushDateItem.attr('data-lastPushDate')
|
||||
const diffDay = diffDate(lastPushDate, true)
|
||||
console.log(diffDay)
|
||||
$lastPushDateItem.text(diffDay)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,7 +805,7 @@ const refreshFn = function () {
|
||||
addLightBox()
|
||||
scrollFn()
|
||||
GLOBAL_CONFIG.runtime && addRuntime()
|
||||
GLOBAL_CONFIG.last_push_date !== undefined && addLastPushDate()
|
||||
addLastPushDate()
|
||||
addTableWrap()
|
||||
clickFnOfTagHide()
|
||||
tabsFn.clickFnOfTabs()
|
||||
|
||||
Reference in New Issue
Block a user