feat: support customData in config

pull/207/head
Evan You 4 years ago
parent 9c7906119e
commit 4072dc5f7e

@ -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> {
@ -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
types/shared.d.ts vendored

@ -17,6 +17,7 @@ export interface SiteData<ThemeConfig = any> {
head: HeadConfig[]
themeConfig: ThemeConfig
locales: Record<string, LocaleConfig>
customData: any
}
export type HeadConfig =

Loading…
Cancel
Save