Skip to content

Commit f70560c

Browse files
committed
fix: content id generation
1 parent 93980a2 commit f70560c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/content.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const localized = <T extends z.ZodTypeAny>(schema: T) =>
1414
);
1515

1616
const blogCollection = defineCollection({
17-
loader: glob({ pattern: "**/[^_]*.mdx", base: "./src/content/blog"}),
17+
loader: glob({ pattern: "**/[^_]*.{md,mdx}", base: "./src/content/blog", generateId: ({entry}) => entry }),
1818
schema: ({ image }) =>
1919
z.object({
2020
title: z.string(),
@@ -30,7 +30,7 @@ const blogCollection = defineCollection({
3030
}),
3131
});
3232
const notesCollection = defineCollection({
33-
loader: glob({ pattern: "**/[^_]*.mdx", base: "./src/content/notes"}),
33+
loader: glob({ pattern: "**/[^_]*.{md,mdx}", base: "./src/content/notes", generateId: ({entry}) => entry }),
3434
schema: z.object({
3535
title: z.string(),
3636
}),
@@ -51,7 +51,7 @@ const galleryCollection = defineCollection({
5151
}),
5252
});
5353
const projectsCollection = defineCollection({
54-
loader: glob({ pattern: "**/[^_]*.mdx", base: "./src/content/projects"}),
54+
loader: glob({ pattern: "**/[^_]*.{md,mdx}", base: "./src/content/projects"}),
5555
schema: ({ image }) =>
5656
z.object({
5757
title: z.string(),
@@ -69,7 +69,7 @@ const projectsCollection = defineCollection({
6969
}),
7070
});
7171
const pagesCollection = defineCollection({
72-
loader: glob({ pattern: "**/[^_]*.mdx", base: "./src/content/pages"}),
72+
loader: glob({ pattern: "**/[^_]*.{md,mdx}", base: "./src/content/pages"}),
7373
schema: z.object({
7474
path: z.string(),
7575
title: z.string(),
@@ -89,7 +89,7 @@ const navigationCollection = defineCollection({
8989
),
9090
});
9191
const sectionsCollection = defineCollection({
92-
loader: glob({ pattern: "**/[^_]*.mdx", base: "./src/content/sections"}),
92+
loader: glob({ pattern: "**/[^_]*.{md,mdx}", base: "./src/content/sections"}),
9393
schema: z.object({}),
9494
})
9595

0 commit comments

Comments
 (0)