Skip to content

Commit

Permalink
Merge pull request #172 from sushichan044/fix/use-legacy-collection-f…
Browse files Browse the repository at this point in the history
…or-blog

fix: enable legacy collection
  • Loading branch information
sushichan044 authored Dec 21, 2024
2 parents 6d60180 + a0825a9 commit d36b436
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/sushichan.live/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default defineConfig({
react(),
tailwind(),
],
legacy: {
collections: true,
},
markdown: {
gfm: true,
rehypePlugins: [rehypeUnwrapImages, rehypeKatex],
Expand Down
5 changes: 3 additions & 2 deletions packages/sushichan.live/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { cldAssetsLoader } from "astro-cloudinary/loaders";
import { glob } from "astro/loaders";
import { defineCollection, reference, z } from "astro:content";

const baseSchema = z.object({
Expand All @@ -19,9 +18,11 @@ const blogSpecificSchema = z.object({

const blogSchema = baseSchema.merge(blogSpecificSchema);

// see: https://github.com/withastro/astro/issues/12784
// somehow new glob loader is broken
const posts = defineCollection({
loader: glob({ base: "./src/content/posts", pattern: "**/*.mdx?" }),
schema: blogSchema,
type: "content",
});

const cldImages = defineCollection({
Expand Down

0 comments on commit d36b436

Please sign in to comment.