fix: 修復當關閉代碼渲染后,標簽外挂裏的代碼塊會被壓縮到一行的bugs

improvements: 優化網站最後更新時間顯示,’0天前‘改爲’今天‘
This commit is contained in:
Jerry
2020-08-24 22:56:58 +08:00
Unverified
parent 4aacafdae1
commit 40fd319cb2
14 changed files with 109 additions and 20 deletions

View File

@@ -633,10 +633,12 @@ const addLastPushDate = () => {
if ($lastPushDateItem.length) {
const lastPushDate = $lastPushDateItem.attr('last-push-date')
const diffDay = diffDate(lastPushDate)
if (diffDay > 365) {
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)
$lastPushDateItem.text(diffDay + ' ' + GLOBAL_CONFIG.last_push_date.suffix)
}
}
}
@@ -808,7 +810,7 @@ const refreshFn = function () {
addLightBox()
scrollFn()
GLOBAL_CONFIG.runtime && addRuntime()
GLOBAL_CONFIG.last_push_date && addLastPushDate()
GLOBAL_CONFIG.last_push_date !== undefined && addLastPushDate()
addTableWrap()
clickFnOfTagHide()
tabsFn.clickFnOfTabs()