🚧 Rspress 2.0 文档还在开发中
close

EditLink eject-only

Warning

该组件是 eject-only 组件,专门为 wrap/eject 设计,不建议在 MDX 文件中直接使用

EditLink 用于渲染"编辑此页"链接,点击后跳转到文档源文件的编辑页面(如 GitHub)。

用法

该组件通常作为 DocFooter 的一部分自动渲染,无需手动使用。

相关配置

rspress.config.ts 中配置 editLink

rspress.config.ts
import { defineConfig } from '@rspress/core';

export default defineConfig({
  themeConfig: {
    editLink: {
      docRepoBaseUrl:
        'https://github.com/web-infra-dev/rspress/tree/main/website/docs',
      text: '📝 在 GitHub 上编辑此页',
    },
  },
});
  • docRepoBaseUrl - 文档仓库的基础 URL
  • text - 链接显示的文本

如果未配置 editLink,组件不会渲染任何内容。