From 988cbcc331eea131eee2d588f7f1098bf22d316d Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Thu, 6 Aug 2020 21:45:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=BE=A9pjax=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=99=82=E9=96=8B=E5=95=93Open=5FGraph=5Fmet?= =?UTF-8?q?a=E5=92=8CLivere=EF=BC=8CLivere=E8=A9=95=E8=AB=96=E5=BE=8C?= =?UTF-8?q?=E8=87=BA=E9=A1=AF=E7=A4=BA=E7=9A=84=E4=BE=86=E6=BA=90=E9=A0=81?= =?UTF-8?q?=E9=9D=A2=E8=88=87=E5=AF=A6=E9=9A=9B=E4=B8=8D=E5=90=8C=20?= =?UTF-8?q?=E7=9A=84bugs=20#294?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/third-party/pjax.pug | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/layout/includes/third-party/pjax.pug b/layout/includes/third-party/pjax.pug index b15b058..af212fb 100644 --- a/layout/includes/third-party/pjax.pug +++ b/layout/includes/third-party/pjax.pug @@ -1,16 +1,22 @@ script(src=url_for(theme.CDN.pjax)) script. - var pjax = new Pjax({ + let pjaxSelectors = [ + 'title', + 'meta[name=description]', + '#config_change', + '#body-wrap', + '#rightside-config-hide', + '#rightside-config-show', + '.js-pjax' + ] + + if (!{theme.Open_Graph_meta && 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"])', - selectors: [ - 'title', - 'meta[name=description]', - '#config_change', - '#body-wrap', - '#rightside-config-hide', - '#rightside-config-show', - '.js-pjax' - ], + selectors: pjaxSelectors, cacheBust: false, }) From 82979322c613ff442684a63d5c6e43e6e1459e59 Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Fri, 7 Aug 2020 18:11:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=BE=A9Hexo=205.0.0=20?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E7=89=88=E6=9C=AC=EF=BC=8C=20toc=E9=81=87?= =?UTF-8?q?=E5=88=B0=E4=B8=AD=E6=96=87=E4=B8=8D=E6=9C=83=E6=BB=BE=E5=8B=95?= =?UTF-8?q?=E7=9A=84bugs=20close=20#297,=20close=20#299?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/head/config.pug | 1 + scripts/helpers/page.js | 4 ++++ source/js/main.js | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/layout/includes/head/config.pug b/layout/includes/head/config.pug index 3ad380a..61c26ea 100644 --- a/layout/includes/head/config.pug +++ b/layout/includes/head/config.pug @@ -88,6 +88,7 @@ script. var GLOBAL_CONFIG = { root: '!{config.root}', + hexoversion: '!{get_hexo_version()}', algolia: !{algolia}, localSearch: !{localSearch}, translate: !{translate}, diff --git a/scripts/helpers/page.js b/scripts/helpers/page.js index f827ccf..87d13b5 100644 --- a/scripts/helpers/page.js +++ b/scripts/helpers/page.js @@ -61,3 +61,7 @@ hexo.extend.helper.register('urlNoIndex', function () { hexo.extend.helper.register('md5', function (path) { return crypto.createHash('md5').update(decodeURI(this.url_for(path))).digest('hex') }) + +hexo.extend.helper.register('get_hexo_version', function () { + return hexo.version +}) \ No newline at end of file diff --git a/source/js/main.js b/source/js/main.js index 5bcbe45..8fcd473 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -465,6 +465,7 @@ const tocFn = function () { // DOM Hierarchy: // ol.toc > (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) { // assume that we are not in the post page if no TOC link be found, // thus no need to update the status @@ -477,7 +478,8 @@ const tocFn = function () { list.each(function () { const head = $(this) if (top > head.offset().top - 25) { - currentId = '#' + encodeURI($(this).attr('id')) + if (versionBiggerFive) currentId = '#' + encodeURI($(this).attr('id')) + else currentId = '#' + $(this).attr('id') } }) From 1ac43323fc9e1f153d5d0e7db16bcb109d29c5b4 Mon Sep 17 00:00:00 2001 From: Akira Lin <64728373+SerokSSR@users.noreply.github.com> Date: Sat, 8 Aug 2020 12:06:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=BE=A9=E8=A9=95=E8=AB=96?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E7=88=B2=E7=A9=BA=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/third-party/pjax.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/includes/third-party/pjax.pug b/layout/includes/third-party/pjax.pug index af212fb..a8ff1d1 100644 --- a/layout/includes/third-party/pjax.pug +++ b/layout/includes/third-party/pjax.pug @@ -10,7 +10,7 @@ script. '.js-pjax' ] - if (!{theme.Open_Graph_meta && theme.comments.use.includes('Livere')}) { + 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"]') } From 44e16d154a708ddda6d3990166a56ac5222ce910 Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Tue, 11 Aug 2020 21:15:34 +0800 Subject: [PATCH 4/4] =?UTF-8?q?:bookmark:=203.0.1=E6=9B=B4=E6=96=B0=20:bug?= =?UTF-8?q?:=20=E4=BF=AE=E5=BE=A9=E5=B0=8E=E8=88=AA=E5=81=B4=E9=82=8A?= =?UTF-8?q?=E6=AC=84=E6=B2=92=E6=9C=89=E9=80=B2=E5=85=A5=E7=89=B9=E6=95=88?= =?UTF-8?q?=E7=9A=84Bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- source/css/_global/index.styl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c8bac68..53ee22c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "3.0.0", + "version": "3.0.1", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/source/css/_global/index.styl b/source/css/_global/index.styl index 4877bc4..8de27f3 100644 --- a/source/css/_global/index.styl +++ b/source/css/_global/index.styl @@ -249,7 +249,7 @@ if hexo-config('avatar.effect') == true for i in 1 2 3 4 > :nth-child({i}) - animation: sidebarItem (i / 5) s + animation: sidebarItem (i / 5)s @keyframes scroll-down-effect 0%