Skip to content

Commit a1f7fda

Browse files
committed
Refactor
1 parent 9f155c9 commit a1f7fda

File tree

1 file changed

+3
-3
lines changed
  • playground/rsc-vite-framework/app/routes/mdx-glob.$post/posts

1 file changed

+3
-3
lines changed

playground/rsc-vite-framework/app/routes/mdx-glob.$post/posts/posts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ async function resolvePosts(): Promise<{
1919
>;
2020

2121
return Object.fromEntries(
22-
Object.entries(rawPosts).map(([path, loadPost]) => {
23-
const slug = path.split("/").pop()!.replace(".mdx", "");
22+
Object.entries(rawPosts).map(([importPath, loadPost]) => {
23+
const slug = importPath.split("/").pop()!.replace(".mdx", "");
2424

2525
return [
2626
slug,
@@ -38,7 +38,7 @@ async function resolvePosts(): Promise<{
3838
} else {
3939
const prettyPath = nodePath.relative(
4040
process.cwd(),
41-
nodePath.resolve(import.meta.dirname, path),
41+
nodePath.resolve(import.meta.dirname, importPath),
4242
);
4343
console.error(
4444
`Invalid frontmatter for ${prettyPath}: Missing title`,

0 commit comments

Comments
 (0)