From 39b5742adc26d3f44a6c9c1733f05c401ca0efcf Mon Sep 17 00:00:00 2001 From: tangly Date: Tue, 18 Oct 2022 22:06:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog.config.js b/blog.config.js index 9df8a616..9e8a2eb2 100644 --- a/blog.config.js +++ b/blog.config.js @@ -17,7 +17,7 @@ const BLOG = { FACEBOOK_PAGE_ID: process.env.NEXT_PUBLIC_FACEBOOK_PAGE_ID || '', // Facebook Page ID 來啟用 messenger 聊天功能 FACEBOOK_APP_ID: process.env.NEXT_PUBLIC_FACEBOOK_APP_ID || '', // Facebook App ID 來啟用 messenger 聊天功能 获取: https://developers.facebook.com/ - THEME: process.env.NEXT_PUBLIC_THEME || 'next', // 主题, 支持 ['next','hexo',"fukasawa','medium','example'] @see https://preview.tangly1024.com + THEME: process.env.NEXT_PUBLIC_THEME || 'hexo', // 主题, 支持 ['next','hexo',"fukasawa','medium','example'] @see https://preview.tangly1024.com THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮 LANG: 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more. HOME_BANNER_IMAGE: './bg_image.jpg', // 首页背景大图,默认文件:/public/bg_image.jpg 。会被Notion中的封面图覆盖。 @@ -146,7 +146,7 @@ const BLOG = { icon: process.env.NEXT_PUBLIC_NOTION_PROPERTY_ICON || 'icon' }, - ENABLE_CACHE: false, // 开启缓存 会将Notion数据缓存在内存中,稍微提升访问速度,但要更新内容需要多次刷新页面 + ENABLE_CACHE: process.env.ENABLE_CACHE || false, // 开启缓存 会将Notion数据缓存在内存中,稍微提升访问速度,但要更新内容需要多次刷新页面 AVATAR: '/avatar.png', // 作者头像,被notion中的ICON覆盖。如果没有ICON则取public目录下的avatar.png TITLE: process.env.NEXT_PUBLIC_TITLE || 'NotionNext BLOG', // 站点标题 ,被notion中的页面标题覆盖 From 556d3d8cd4bd92b37405e6391e10a9e6c921e73e Mon Sep 17 00:00:00 2001 From: tangly Date: Tue, 18 Oct 2022 22:08:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?slug=E9=A2=84=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/[...slug].js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/[...slug].js b/pages/[...slug].js index 39246577..76862023 100644 --- a/pages/[...slug].js +++ b/pages/[...slug].js @@ -87,9 +87,9 @@ export async function getStaticPaths() { } const from = 'slug-paths' - const { allPosts } = await getGlobalNotionData({ from }) + const { allPages } = await getGlobalNotionData({ from }) return { - paths: allPosts.map(row => ({ params: { slug: row.slug } })), + paths: allPages.map(row => ({ params: { slug: row.slug } })), fallback: true } } From 59411e0886f972743ac788139b386eff8f7b0a42 Mon Sep 17 00:00:00 2001 From: tangly Date: Tue, 18 Oct 2022 22:15:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/[...slug].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/[...slug].js b/pages/[...slug].js index 76862023..015f053f 100644 --- a/pages/[...slug].js +++ b/pages/[...slug].js @@ -89,7 +89,7 @@ export async function getStaticPaths() { const from = 'slug-paths' const { allPages } = await getGlobalNotionData({ from }) return { - paths: allPages.map(row => ({ params: { slug: row.slug } })), + paths: allPages.map(row => ({ params: { slug: [row.slug] } })), fallback: true } }