From 9f64302ab69945da82a3f322437634c9bc5a5b5f Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 29 Apr 2024 13:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E7=9A=84?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/mapImage.js | 2 +- next.config.js | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/notion/mapImage.js b/lib/notion/mapImage.js index e0d92f83..dba99d5c 100644 --- a/lib/notion/mapImage.js +++ b/lib/notion/mapImage.js @@ -60,7 +60,7 @@ const mapImgUrl = (img, block, type = 'block', from = 'post') => { } // 图片url优化,确保每一篇文章的图片url唯一 - if (ret && ret.length > 4) { + if (ret && !ret.includes('https://www.notion.so/images/')) { // 图片接口拼接唯一识别参数,防止请求的图片被缓,而导致随机结果相同 const separator = ret.includes('?') ? '&' : '?' ret = `${ret.trim()}${separator}t=${block.id}` diff --git a/next.config.js b/next.config.js index f4352e6e..5c1ba810 100644 --- a/next.config.js +++ b/next.config.js @@ -54,21 +54,6 @@ function scanSubdirectories(directory) { } const nextConfig = { - images: { - // 图片压缩 - formats: ['image/avif', 'image/webp'], - // 允许next/image加载的图片 域名 - domains: [ - 'gravatar.com', - 'www.notion.so', - 'avatars.githubusercontent.com', - 'images.unsplash.com', - 'source.unsplash.com', - 'p1.qhimg.com', - 'webmention.io', - 'ko-fi.com' - ] - }, // 默认将feed重定向至 /public/rss/feed.xml async redirects() { return [