Skip to content

Commit

Permalink
feat: support customData in config
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 12, 2021
1 parent 9c79061 commit 4072dc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface UserConfig<ThemeConfig = any> {
locales?: Record<string, LocaleConfig>
alias?: Record<string, string>
markdown?: MarkdownOptions
// TODO locales support etc.
customData?: any
}

export interface SiteConfig<ThemeConfig = any> {
Expand Down Expand Up @@ -91,6 +91,7 @@ export async function resolveSiteData(root: string): Promise<SiteData> {
base: userConfig.base ? userConfig.base.replace(/([^/])$/, '$1/') : '/',
head: userConfig.head || [],
themeConfig: userConfig.themeConfig || {},
locales: userConfig.locales || {}
locales: userConfig.locales || {},
customData: userConfig.customData || {}
}
}
1 change: 1 addition & 0 deletions types/shared.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface SiteData<ThemeConfig = any> {
head: HeadConfig[]
themeConfig: ThemeConfig
locales: Record<string, LocaleConfig>
customData: any
}

export type HeadConfig =
Expand Down

0 comments on commit 4072dc5

Please sign in to comment.