For AI agents: the complete documentation index is available at https://rspress.rs/zh/llms.txt, the full documentation bundle is available at https://rspress.rs/zh/llms-full.txt, and this page is available as Markdown at https://rspress.rs/zh/index.md.
✨ 用 rspress-custom-theme skill 轻松定制 Rspress 主题
close
  • 中文
  • Rspress
    快如闪电的
    静态站点生成器

    面向人,也面向 AI

    npm
    yarn
    pnpm
    bun
    deno
    npm create rspress@latest

    极高的编译性能

    核心编译模块基于 Rust 前端工具链完成,带来更加极致的开发体验。

    支持 MDX

    MDX 是一种强大的内容编写方式,你可以在 Markdown 中使用 React 组件。

    内置全文搜索

    构建时自动为你生成全文搜索索引,提供开箱即用的全文搜索能力。

    AI 友好

    通过 SSG-MD 生成符合 llms.txt 规范的索引文件和 Markdown 文件,便于大语言模型理解和使用你的技术文档。

    静态站点生成

    生产环境下,会自动构建为静态 HTML 文件,你可以轻松的部署到任何地方。

    提供多种自定义能力

    通过插件和自定义主题机制,你可以轻松的扩展主题 UI 和构建能力。

    SSG-MD · llms.txt

    人看 HTML, AI 读 Markdown

    同一份源文件,两套产物。每个页面既是给人阅读的 HTML(SSG),也是给大语言模型的 Markdown 副本(SSG-MD),并遵循 llms.txt 规范生成站点级索引与全文。

    • 每个页面都有 .md 副本,URL 中 .html 换成 .md 即可访问
    • 按导航结构生成 llms.txt 索引与 llms-full.txt 全文
    • MDX 组件渲染为干净的 Markdown,而非语法噪音
    了解 SSG-MD
    doc_build
    SSGSSG-MD
    guide
    start
    introduction.html
    introduction.md
    llms.txtindex
    llms-full.txtfull
    # Introduction
    Rspress is a lightning fast static site
    generator based on Rsbuild.
    ```ts title="index.ts"
    console.log('Hello Rspress');
    ```
    _nav.json / _meta.json

    导航与侧边栏,自动生成

    在内容旁边声明导航结构:Rspress 通过 _nav.json 和 _meta.json 生成导航栏与侧边栏,并支持热更新,结构调整即时生效。

    • _nav.json 生成导航栏,各目录 _meta.json 生成侧边栏
    • 支持排序、标签、图标、分组标题、分隔线与自定义链接
    • 页面元信息写在 frontmatter 中,与内容放在一起
    了解自动生成导航
    docs/guide/_meta.json
    [
    {
    "type": "section-header",
    "label": "Guide"
    },
    "introduction",
    "quick-start",
    {
    "type": "dir",
    "name": "advanced"
    }
    ]
    Guide
    Introduction
    Quick Start
    Advanced
    插件与主题

    扩展构建流程,定制主题外观

    通过插件机制介入构建的每个阶段,主题则可以从 CSS 变量一路定制到完全弹出的组件源码。

    • 官方插件覆盖搜索、Sitemap、API 文档、组件预览等场景
    • 主题定制:CSS 变量、布局插槽,或 rspress eject 弹出源码
    • 使用 rspress-custom-theme skill,让 AI Agent 辅助完成主题定制
    开始定制
    theme/index.tsx · slots
    beforeNavTitle
    beforeSidebar
    beforeDocContent