mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e4c20f6d4 | ||
|
|
e984efa35c | ||
|
|
863cf1e780 | ||
|
|
8603db0545 |
@@ -14,8 +14,8 @@
|
||||
hits_stats: _p("algolia_search.hits_stats")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let localSearch = 'undefined';
|
||||
if (theme.local_search && theme.local_search.enable) {
|
||||
localSearch = JSON.stringify({
|
||||
@@ -58,7 +58,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
let Snackbar = 'undefined';
|
||||
if (theme.snackbar && theme.snackbar.enable) {
|
||||
Snackbar = JSON.stringify({
|
||||
@@ -95,15 +94,11 @@
|
||||
})
|
||||
}
|
||||
|
||||
let date_suffix = 'undefined';
|
||||
if (theme.aside.card_webinfo.last_push_date) {
|
||||
date_suffix = JSON.stringify({
|
||||
one_hour: _p("date_suffix.one_hour"),
|
||||
hours: _p("date_suffix.hours"),
|
||||
day: _p('date_suffix.day')
|
||||
|
||||
})
|
||||
}
|
||||
let date_suffix = JSON.stringify({
|
||||
one_hour: _p("date_suffix.one_hour"),
|
||||
hours: _p("date_suffix.hours"),
|
||||
day: _p('date_suffix.day')
|
||||
})
|
||||
|
||||
script.
|
||||
var GLOBAL_CONFIG = {
|
||||
@@ -139,18 +134,18 @@ script.
|
||||
islazyload: !{theme.lazyload.enable},
|
||||
isanchor: !{theme.anchor}
|
||||
};
|
||||
|
||||
|
||||
var saveToLocal = {
|
||||
set: function setWithExpiry(key, value, ttl) {
|
||||
const now = new Date()
|
||||
const expiryDay = ttl * 86400000
|
||||
const item = {
|
||||
value: value,
|
||||
expiry: now.getTime() + expiryDay,
|
||||
}
|
||||
localStorage.setItem(key, JSON.stringify(item))
|
||||
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)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "3.1.0",
|
||||
"version": "3.1.1",
|
||||
"description": "A Simple and Card UI Design theme for Hexo",
|
||||
"main": "package.json",
|
||||
"scripts": {
|
||||
@@ -23,7 +23,7 @@
|
||||
"email": "wong@jerryc.me"
|
||||
},
|
||||
"dependencies": {
|
||||
"hexo-renderer-stylus": "^2.0.0",
|
||||
"hexo-renderer-stylus": "^2.0.1",
|
||||
"hexo-renderer-pug": "^1.0.0"
|
||||
},
|
||||
"homepage": "https://demo.jerryc.me/",
|
||||
|
||||
@@ -196,7 +196,7 @@ $(function () {
|
||||
const isHighlightLang = GLOBAL_CONFIG.highlight.highlightLang
|
||||
const isHighlightShrink = GLOBAL_CONFIG_SITE.isHighlightShrink
|
||||
const isShowTool = isHighlightCopy || isHighlightLang || isHighlightShrink !== undefined
|
||||
const $figureHighlight = GLOBAL_CONFIG.highlight.plugin === 'highlighjs' ? $('figure.highlight') : $('pre[class*="language-"')
|
||||
const $figureHighlight = GLOBAL_CONFIG.highlight.plugin === 'highlighjs' ? $('figure.highlight') : $('pre[class*="language-"]')
|
||||
|
||||
if (isShowTool && $figureHighlight.length) {
|
||||
const isPrismjs = GLOBAL_CONFIG.highlight.plugin === 'prismjs'
|
||||
|
||||
Reference in New Issue
Block a user