零依赖支持 MDX为 SSR 而生跨框架

    渲染速度快 5 倍的 Markdown。

    Intlayer 内置了自己的 Markdown 引擎。零依赖、支持 MDX、在服务端解析,并在 React、Next.js、Vue、Svelte、Solid、Preact 和 Angular 中原生渲染。你再也不用挑选渲染器了。

    markdown-file.content.md
    ---key: my-markdown-contentdescription: My content---# My contentHere an example of markdown content

    当省略 front-matter 中的 locale 字段时,Intlayer 将使用配置的默认语言。无需语言前缀即可在单个 Markdown 文件中管理全部内容。

    文件结构示例:
    content
    └── markdown-file.content.md
    markdown-file.en.content.md
    ---key: my-markdown-contentdescription: My contentlocale: en---# My contentHere an example of markdown content

    front-matter 中的 locale 字段用于定义内容的语言。它是可选的。若未提供,Intlayer 将使用默认语言,若特定语言没有可用翻译,它也将用作后备语言。

    文件结构示例:
    content
    ├── markdown-file.en.content.md
    ├── markdown-file.fr.content.md
    └── markdown-file.es.content.md
    article.content.ts
    import { md, file, t, type Dictionary } from 'intlayer';export default {  key: 'article',  content: {    body: t({      en: md(file('./article.en.md')),      fr: md(file('./article.fr.md')),    }),  },} satisfies Dictionary;

    在 TypeScript、ESM 或 JSON 词典中直接使用 md() 和 file() 函数声明 Markdown,兼顾翻译与完整的类型安全性。

    文件结构示例:
    content
    ├── article.content.ts
    ├── article.en.md
    └── article.fr.md
    无依赖
    MDX 组件
    带类型的 frontmatter
    未使用时被移除