fix: 修復夜間模式下,閲讀模式代碼塊背景顔色的顯示bug

fix: 修復在 chrome上,進入頁面時,頁面元素會出現模糊到清晰的bug close #479
fix: 修復 文章頁面上滑子菜單圖標文字無法顯示的 bug close #481
improvement: meta description 限制在150字以內 close #480
improvement: pug優化和結構調整
This commit is contained in:
Jerry committed 2021-01-29 23:38:13 +08:00
1 parent 6962353af6
commit 2cd1aa5bc9
13 files changed
+163 -127

No files matched your search

+1 -1
View File
@@ -72,6 +72,6 @@ if theme.blog_title_font && theme.blog_title_font.font_link
include ./head/config_site.pug
include ./head/noscript.pug
!=partial('includes/head/js', {}, {cache: true})
!=fragment_cache('injectHeadJs', function(){return inject_head_js()})
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
-45
View File
@@ -124,49 +124,4 @@ script.
isPhotoFigcaption: !{theme.photofigcaption},
islazyload: !{theme.lazyload.enable},
isanchor: !{theme.anchor}
};
const saveToLocal = {
// ttl 單位是 天
set: function setWithExpiry(key, value, ttl) {
if (ttl === 0) return
const now = new Date()
const expiryDay = ttl * 86400000
const item = {
value: value,
expiry: now.getTime() + expiryDay,
}
localStorage.setItem(key, JSON.stringify(item))
},
get: function getWithExpiry(key) {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = new Date()
if (now.getTime() > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
// https://stackoverflow.com/questions/16839698/jquery-getscript-alternative-in-native-javascript
const getScript = url => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
document.head.appendChild(script)
})
+1 -1
View File
@@ -8,7 +8,7 @@
var showToc = is_post() && theme.aside.enable && pageToc && (toc(page.content) !== '' || page.encrypt == true )
-
script#config_change
script#config-diff
.
var GLOBAL_CONFIG_SITE = {
isPost: !{is_post()},
Loaded 3 of 13 files, more files were not shown because too many files have changed in this diff. Show more