Fuma Content

Obsidian Collection

Support Obsidian-style Markdown.

Usage

It is same as MDX Collection, for example:

content.config.ts
import { defineConfig } from "fuma-content/config";
import { mdxObsidianCollection } from "fuma-content/collections/obsidian";
import { z } from "zod";

const docs = mdxObsidianCollection({
  dir: "content",
  frontmatter: z.object({
    title: z.string().optional(),
  }),

  // optional: MDX options
  options: () => ({
    jsxImportSource: "react",
  }),
});

export default defineConfig({
  collections: { docs },
});

It requires the following MDX component to be defined:

  • ObsidianCallout: container for callout, receive a type prop for the type of callout.
  • ObsidianCalloutTitle: container for callout title.
  • ObsidianCalloutBody: main body of callout.

On this page