diff --git a/.github/make-post-list.js b/.github/make-post-list.js index c5a85bb..5c7acc2 100644 --- a/.github/make-post-list.js +++ b/.github/make-post-list.js @@ -54,7 +54,7 @@ const getAllFilePath = async (dirPath) => { ...(await readFromDirectory(joined)).map((foundName) => [ [dir, name].join("/"), foundName, - ]) + ]), ); } } @@ -95,19 +95,21 @@ const postCount = 5; paths.map(async (filePath) => ({ filePath, stat: await getFileStat(path.join(process.cwd(), postBasePath, filePath)), - })) + })), ); const metas = await Promise.all( fileStats .map(({ filePath }) => getFileMeta(getPostPath(filePath))) - .filter(Boolean) + .filter(Boolean), ); const filtered = metas .sort((a, b) => new Date(b.date) - new Date(a.date)) .slice(0, postCount); const posts = filtered.map(({ filePath }, index) => { + const lastSlashIndex = filePath.lastIndexOf("/"); + const fileName = filePath.substring(lastSlashIndex + 1); return { - path: `${blogPath}/posts${filePath.replace(".mdx", "")}`, + path: `${blogPath}/posts/${fileName.replace(".mdx", "")}`, meta: metas[index], }; }); diff --git a/src/posts/72-custom-ssr-server-bundling.mdx b/src/posts/72-custom-ssr-server-bundling.mdx index 6ffee63..25954ed 100644 --- a/src/posts/72-custom-ssr-server-bundling.mdx +++ b/src/posts/72-custom-ssr-server-bundling.mdx @@ -3,7 +3,7 @@ id: 72 title: SSR 서버 만들기 (2) - 번들링과 트랜스파일 description: tags: Babel,Webpack -date: 2023-10-09 +date: 2023-10-10 ---