Skip to content

Commit

Permalink
feat(config): add sitePattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Sep 26, 2024
1 parent 8a05f70 commit c87ac00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function genConfig() {
baseUrl = '/',
enableChangeLog = true,
enableSuggestionBox = true,
sitePattern,
} = themeConfig
return defineConfigWithTheme<PjtsThemeConfig>({
lang: 'zh-CN',
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/utils/themeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface ThemeContext {
sidebarOptions: VitePressSidebarOptions[]
enableSuggestionBox?: boolean
enableChangeLog?: boolean
sitePattern?: string
}

const themeContext = new AsyncLocalStorage<ThemeContext>()
Expand Down

0 comments on commit c87ac00

Please sign in to comment.