Merge branch 'master' into dev

This commit is contained in:
DefectingCat
2022-10-11 17:41:02 +08:00
3 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
---
title: 现代前端的Web应用路由-为React打造一个迷你路由器
title: 自建简易 FaaS
date: '2022-10-10'
tags: [JavaScript, TypeScript]
---

View File

@ -11,6 +11,7 @@ const nextConfig = {
images: isExport ? { unoptimized: true } : {},
experimental: {
// runtime: 'nodejs',
largePageDataBytes: 512 * 1000,
},
compiler: {
removeConsole: process.env.NODE_ENV === 'production',

View File

@ -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);