Skip to content

Commit

Permalink
fix: remove dir path from post path
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Jan 3, 2024
1 parent 15677bb commit 61f419f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/make-post-list.js
Expand Up @@ -54,7 +54,7 @@ const getAllFilePath = async (dirPath) => {
...(await readFromDirectory(joined)).map((foundName) => [
[dir, name].join("/"),
foundName,
])
]),
);
}
}
Expand Down Expand Up @@ -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],
};
});
Expand Down
2 changes: 1 addition & 1 deletion src/posts/72-custom-ssr-server-bundling.mdx
Expand Up @@ -3,7 +3,7 @@ id: 72
title: SSR 서버 만들기 (2) - 번들링과 트랜스파일
description:
tags: Babel,Webpack
date: 2023-10-09
date: 2023-10-10
---


Expand Down

1 comment on commit 61f419f

@vercel
Copy link

@vercel vercel bot commented on 61f419f Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.