Compare commits

..

21 Commits
3.0.1 ... 3.0.0

7 changed files with 14 additions and 27 deletions

View File

@@ -252,7 +252,7 @@ comments:
# - Disqus # - Disqus
text: true # Display the comment name next to the button text: true # Display the comment name next to the button
# lazyload: The comment system will be load when comment element enters the browser's viewport. # lazyload: The comment system will be load when comment element enters the browser's viewport.
# If you set it to false, the comment count will be invalid # If you set it to true, the comment count will be invalid
lazyload: false lazyload: false
count: false # Display comment count in top_img count: false # Display comment count in top_img

View File

@@ -88,7 +88,6 @@
script. script.
var GLOBAL_CONFIG = { var GLOBAL_CONFIG = {
root: '!{config.root}', root: '!{config.root}',
hexoversion: '!{get_hexo_version()}',
algolia: !{algolia}, algolia: !{algolia},
localSearch: !{localSearch}, localSearch: !{localSearch},
translate: !{translate}, translate: !{translate},

View File

@@ -1,22 +1,16 @@
script(src=url_for(theme.CDN.pjax)) script(src=url_for(theme.CDN.pjax))
script. script.
let pjaxSelectors = [ var pjax = new Pjax({
'title',
'meta[name=description]',
'#config_change',
'#body-wrap',
'#rightside-config-hide',
'#rightside-config-show',
'.js-pjax'
]
if (!{theme.Open_Graph_meta && theme.comments.use && theme.comments.use.includes('Livere')}) {
pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
}
const pjax = new Pjax({
elements: 'a:not([target="_blank"])', elements: 'a:not([target="_blank"])',
selectors: pjaxSelectors, selectors: [
'title',
'meta[name=description]',
'#config_change',
'#body-wrap',
'#rightside-config-hide',
'#rightside-config-show',
'.js-pjax'
],
cacheBust: false, cacheBust: false,
}) })

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "3.0.1", "version": "3.0.0",
"description": "A Simple and Card UI Design theme for Hexo", "description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json", "main": "package.json",
"scripts": { "scripts": {

View File

@@ -61,7 +61,3 @@ hexo.extend.helper.register('urlNoIndex', function () {
hexo.extend.helper.register('md5', function (path) { hexo.extend.helper.register('md5', function (path) {
return crypto.createHash('md5').update(decodeURI(this.url_for(path))).digest('hex') return crypto.createHash('md5').update(decodeURI(this.url_for(path))).digest('hex')
}) })
hexo.extend.helper.register('get_hexo_version', function () {
return hexo.version
})

View File

@@ -249,7 +249,7 @@ if hexo-config('avatar.effect') == true
for i in 1 2 3 4 for i in 1 2 3 4
> :nth-child({i}) > :nth-child({i})
animation: sidebarItem (i / 5)s animation: sidebarItem (i / 5) s
@keyframes scroll-down-effect @keyframes scroll-down-effect
0% 0%

View File

@@ -465,7 +465,6 @@ const tocFn = function () {
// DOM Hierarchy: // DOM Hierarchy:
// ol.toc > (li.toc-item, ...) // ol.toc > (li.toc-item, ...)
// li.toc-item > (a.toc-link, ol.toc-2child > (li.toc-item, ...)) // li.toc-item > (a.toc-link, ol.toc-2child > (li.toc-item, ...))
const versionBiggerFive = GLOBAL_CONFIG.hexoversion.split('.')[0] >= 5
const findHeadPosition = function (top) { const findHeadPosition = function (top) {
// assume that we are not in the post page if no TOC link be found, // assume that we are not in the post page if no TOC link be found,
// thus no need to update the status // thus no need to update the status
@@ -478,8 +477,7 @@ const tocFn = function () {
list.each(function () { list.each(function () {
const head = $(this) const head = $(this)
if (top > head.offset().top - 25) { if (top > head.offset().top - 25) {
if (versionBiggerFive) currentId = '#' + encodeURI($(this).attr('id')) currentId = '#' + encodeURI($(this).attr('id'))
else currentId = '#' + $(this).attr('id')
} }
}) })