From 1f3ea5589020528b08e0bb0634d9442c3b551960 Mon Sep 17 00:00:00 2001 From: myw Date: Mon, 13 Jan 2025 00:21:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=96=87=E7=AB=A0=E9=A0=81=E5=88=86?= =?UTF-8?q?=E9=A0=81=E4=B8=8D=E9=A1=AF=E7=A4=BA=E7=9A=84=20bug=20improveme?= =?UTF-8?q?nt:=20=E5=84=AA=E5=8C=96=E9=83=A8=E5=88=86=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=B0=8E=E8=87=B4=E6=96=87=E7=AB=A0=E9=A0=81=E5=88=86=E9=A0=81?= =?UTF-8?q?=E6=A8=A3=E5=BC=8F=E9=8C=AF=E4=BA=82=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- scripts/filters/random_cover.js | 22 ++++++++++++++++------ source/css/_layout/pagination.styl | 9 ++++++--- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d2a5415..094a021 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "5.3.1", + "version": "5.3.2", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/scripts/filters/random_cover.js b/scripts/filters/random_cover.js index 057a67e..e7cc24d 100644 --- a/scripts/filters/random_cover.js +++ b/scripts/filters/random_cover.js @@ -29,7 +29,6 @@ hexo.extend.generator.register('post', locals => { previousIndexes.shift() } - console.log(defaultCover[index]) return defaultCover[index] } @@ -64,9 +63,20 @@ hexo.extend.generator.register('post', locals => { return data } - return locals.posts.sort('date').map(post => ({ - data: handleImg(post), - layout: 'post', - path: post.path - })) + // https://github.com/hexojs/hexo/blob/master/lib%2Fplugins%2Fgenerator%2Fpost.ts + const posts = locals.posts.sort('date').toArray() + const { length } = posts + + return posts.map((post, i) => { + if (i) post.prev = posts[i - 1] + if (i < length - 1) post.next = posts[i + 1] + + post.__post = true + + return { + data: handleImg(post), + layout: 'post', + path: post.path + } + }) }) diff --git a/source/css/_layout/pagination.styl b/source/css/_layout/pagination.styl index 14305a5..0a3be85 100644 --- a/source/css/_layout/pagination.styl +++ b/source/css/_layout/pagination.styl @@ -12,11 +12,10 @@ width: 100% !important .pagination-related - width: 50% height: 150px - +maxWidth768() - width: 100% + +minWidth768() + flex: 1 .info-1 .info-item-2 @@ -31,6 +30,10 @@ margin-top: 40px width: 100% addBorderRadius() + display: flex + + +maxWidth768() + flex-direction: column .layout .pagination From 1e20234d74d13305f8acff708f065d235d9cffcb Mon Sep 17 00:00:00 2001 From: cxyfer Date: Fri, 17 Jan 2025 02:19:21 +0800 Subject: [PATCH 2/2] fix: update addtoany item reference for correct sharing functionality --- layout/includes/third-party/share/addtoany.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/includes/third-party/share/addtoany.pug b/layout/includes/third-party/share/addtoany.pug index d42f3be..2dfbdb5 100644 --- a/layout/includes/third-party/share/addtoany.pug +++ b/layout/includes/third-party/share/addtoany.pug @@ -1,6 +1,6 @@ .addtoany .a2a_kit.a2a_kit_size_32.a2a_default_style - - let addtoanyItem = theme.addtoany.item.split(',') + - let addtoanyItem = theme.share.addtoany.item.split(',') each name in addtoanyItem a(class="a2a_button_" + name)