From c2ca2e15beeb72795a6294cc94edc1f20c374f6d Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 2 Sep 2023 12:48:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9B=BE=E5=BA=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/mapImage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/notion/mapImage.js b/lib/notion/mapImage.js index 951f5d2a..8d7f9fba 100644 --- a/lib/notion/mapImage.js +++ b/lib/notion/mapImage.js @@ -61,7 +61,9 @@ const mapImgUrl = (img, block, type = 'block', from) => { } // Notion 图床转换为永久地址 - if (ret.indexOf('secure.notion-static.com') > 0 && (BLOG.IMG_URL_TYPE === 'Notion' || type !== 'block')) { + const isNotionImg = ret.indexOf('secure.notion-static.com') > 0 || ret.indexOf('prod-files-secure') > 0 + const isImgBlock = BLOG.IMG_URL_TYPE === 'Notion' || type !== 'block' + if (isNotionImg && isImgBlock) { ret = BLOG.NOTION_HOST + '/image/' + encodeURIComponent(ret) + '?table=' + type + '&id=' + block.id } From 60a3650b60be1f922709fe850aedfa61c5f45505 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 29 Apr 2024 14:41:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/next.config.js b/next.config.js index 5c1ba810..bda40204 100644 --- a/next.config.js +++ b/next.config.js @@ -54,6 +54,22 @@ function scanSubdirectories(directory) { } const nextConfig = { + images: { + // 图片压缩 + formats: ['image/avif', 'image/webp', 'image/png'], + // 允许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 [ From 61c6e0d321050f0a872a087ed32e9686d4a98986 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 29 Apr 2024 14:42:11 +0800 Subject: [PATCH 3/3] image hotfix --- next.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index bda40204..d8a6c2ba 100644 --- a/next.config.js +++ b/next.config.js @@ -56,7 +56,7 @@ function scanSubdirectories(directory) { const nextConfig = { images: { // 图片压缩 - formats: ['image/avif', 'image/webp', 'image/png'], + formats: ['image/avif', 'image/webp'], // 允许next/image加载的图片 域名 domains: [ 'gravatar.com',