git 相关

reco_luan2024-02-23

介绍

TIP

用于生成 git 跳转地址和编辑链接。

如果我们文档项目存放在工程的子目录,比如 /docs 文件夹下,我们需要设置 themeConfig.sourceDir./docs

配置

repo

  • 类型: string
  • 详情:项目仓库的 URL。它将被用作 仓库链接 的链接。仓库链接 将会显示为导航栏的最后一个元素。
// .vuepress/config.ts

import { defineUserConfig } from 'vuepress'
import { recoTheme } from 'vuepress-theme-reco'

export default defineUserConfig({
  theme: recoTheme({
    // 如果你按照 `organization/repository` 的格式设置它
    // 我们会将它作为一个 GitHub 仓库
    repo: 'vuejs/vuepress',
    // 你也可以直接将它设置为一个 URL
    repo: 'https://gitlab.com/foo/bar',
  })
})

docsRepo

  • 类型: string
  • 详情:文档源文件的仓库 URL 。它将会用于生成 编辑此页 的链接。如果你不设置该选项,则默认会使用 repo 配置项。但是如果你的文档源文件是在一个不同的仓库内,你就需要设置该配置项了。

docsBranch

  • 类型: string
  • 默认值: 'main'
  • 详情:文档源文件的仓库分支。它将会用于生成 编辑此页 的链接。
// .vuepress/config.ts

import { defineUserConfig } from 'vuepress'
import { recoTheme } from 'vuepress-theme-reco'

export default defineUserConfig({
  theme: recoTheme({
    sourceDir: '/docs',
    gitRepo: 'https://github.com/vuepress-reco/vuepress-theme-reco',
    gitBranch: 'main',
  })
})
最后更新时间 4/30/2024, 3:55:36 AM
ON THIS PAGE