From eced20bfe7af015d69eef147af104df4c3ae88ee Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 31 Jan 2024 16:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=BF=AB=E5=8F=8B=E6=83=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=9B=BE=E7=89=87=E5=8A=A0=E8=BD=BD=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 4 ++-- lib/notion/mapImage.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blog.config.js b/blog.config.js index 8f35f94d..f13937be 100644 --- a/blog.config.js +++ b/blog.config.js @@ -244,7 +244,7 @@ const BLOG = { // ********挂件组件相关******** // ----> 评论互动 可同时开启多个支持 WALINE VALINE GISCUS CUSDIS UTTERRANCES GITALK - COMMENT_HIDE_SINGLE_TAB: process.env.NEXT_PUBLIC_COMMENT_HIDE_SINGLE_TAB || false, //Whether hide the tab when there's no tabs. 只有一个评论组件时是否隐藏切换组件的标签页 + COMMENT_HIDE_SINGLE_TAB: process.env.NEXT_PUBLIC_COMMENT_HIDE_SINGLE_TAB || false, // Whether hide the tab when there's no tabs. 只有一个评论组件时是否隐藏切换组件的标签页 // artalk 评论插件 COMMENT_ARTALK_SERVER: process.env.NEXT_PUBLIC_COMMENT_ARTALK_SERVER || '', // ArtalkServert后端地址 https://artalk.js.org/guide/deploy.html @@ -353,7 +353,7 @@ const BLOG = { process.env.NEXT_PUBLIC_SEO_BAIDU_SITE_VERIFICATION || '', // Remove the value or replace it with your own google site verification code // 微软 Clarity 站点分析 - CLARITY_ID: process.env.NEXT_PUBLIC_CLARITY_ID || null , // 只需要复制Clarity脚本中的ID部分,ID是一个十位的英文数字组合 + CLARITY_ID: process.env.NEXT_PUBLIC_CLARITY_ID || null, // 只需要复制Clarity脚本中的ID部分,ID是一个十位的英文数字组合 // <---- 站点统计 diff --git a/lib/notion/mapImage.js b/lib/notion/mapImage.js index dbb785e1..c26b1ed4 100644 --- a/lib/notion/mapImage.js +++ b/lib/notion/mapImage.js @@ -8,7 +8,7 @@ import BLOG from '@/blog.config' * @param {*} value * @returns */ -const mapImgUrl = (img, block, type = 'block', from) => { +const mapImgUrl = (img, block, type = 'block', from = 'post') => { if (!img) { return null } @@ -56,10 +56,10 @@ const mapImgUrl = (img, block, type = 'block', from) => { } } - // 文章封面压缩 - if (from === 'pageCoverThumbnail' || block.type === 'image') { + console.log('block', block) // 统一压缩图片 - const width = block?.format?.block_width + if (from === 'pageCoverThumbnail' || block.type === 'image' || block.type === 'page') { + const width = block?.format?.block_width || 200 ret = compressImage(ret, width) }