From 8790b67194904fd4ced021dbb6990b9a19082685 Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Tue, 11 Oct 2022 09:52:44 +0800 Subject: [PATCH 1/2] Fix post name --- data/posts/built-simply-faas.mdx | 2 +- pages/p/[slug].tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/data/posts/built-simply-faas.mdx b/data/posts/built-simply-faas.mdx index 917bf89..c9e9aa4 100644 --- a/data/posts/built-simply-faas.mdx +++ b/data/posts/built-simply-faas.mdx @@ -1,5 +1,5 @@ --- -title: 现代前端的Web应用路由-为React打造一个迷你路由器 +title: 自建简易 FaaS date: '2022-10-10' tags: [JavaScript, TypeScript] --- diff --git a/pages/p/[slug].tsx b/pages/p/[slug].tsx index b593a86..31c2fdf 100644 --- a/pages/p/[slug].tsx +++ b/pages/p/[slug].tsx @@ -53,10 +53,11 @@ export const getStaticProps: GetStaticProps<{ tocLength: number; }> = async ({ params }) => { const slug = params?.slug?.toString(); - if (!slug) + if (!slug) { return { notFound: true, }; + } const post = await readSinglePost(slug); const toc = generateToc(post); From d051badc8f94a8d3d7308c7ff65257f708663cef Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Tue, 11 Oct 2022 09:57:27 +0800 Subject: [PATCH 2/2] Update large page data --- next.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/next.config.mjs b/next.config.mjs index e955a14..8f27007 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -11,6 +11,7 @@ const nextConfig = { images: isExport ? { unoptimized: true } : {}, experimental: { // runtime: 'nodejs', + largePageDataBytes: 512 * 1000, }, compiler: { removeConsole: process.env.NODE_ENV === 'production',