diff --git a/src/config.ts b/src/config.ts index 519322b..358dd48 100644 --- a/src/config.ts +++ b/src/config.ts @@ -59,6 +59,7 @@ function genConfig() { baseUrl = '/', enableChangeLog = true, enableSuggestionBox = true, + sitePattern, } = themeConfig return defineConfigWithTheme({ lang: 'zh-CN', @@ -114,7 +115,7 @@ function genConfig() { sidebar: generateSidebar(), socialLinks: [{ icon: 'github', link: githubRepoLink }], editLink: { - pattern: `${githubRepoLink}/edit/main/docs/:path`, + pattern: sitePattern, text: '在 GitHub 上编辑此页面', // label localization }, // label localization diff --git a/src/utils/themeContext.ts b/src/utils/themeContext.ts index cf40e77..2cd8c11 100644 --- a/src/utils/themeContext.ts +++ b/src/utils/themeContext.ts @@ -17,6 +17,7 @@ export interface ThemeContext { sidebarOptions: VitePressSidebarOptions[] enableSuggestionBox?: boolean enableChangeLog?: boolean + sitePattern?: string } const themeContext = new AsyncLocalStorage()