From 4072dc5f7ede381709fce49e9a29d6af4f7ab81a Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 11 Jan 2021 21:55:59 -0500 Subject: [PATCH] feat: support customData in config --- src/node/config.ts | 5 +++-- types/shared.d.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/config.ts b/src/node/config.ts index cfdcfe71..f5625643 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -20,7 +20,7 @@ export interface UserConfig { locales?: Record alias?: Record markdown?: MarkdownOptions - // TODO locales support etc. + customData?: any } export interface SiteConfig { @@ -91,6 +91,7 @@ export async function resolveSiteData(root: string): Promise { base: userConfig.base ? userConfig.base.replace(/([^/])$/, '$1/') : '/', head: userConfig.head || [], themeConfig: userConfig.themeConfig || {}, - locales: userConfig.locales || {} + locales: userConfig.locales || {}, + customData: userConfig.customData || {} } } diff --git a/types/shared.d.ts b/types/shared.d.ts index cf2aa73a..1f14a6a5 100644 --- a/types/shared.d.ts +++ b/types/shared.d.ts @@ -17,6 +17,7 @@ export interface SiteData { head: HeadConfig[] themeConfig: ThemeConfig locales: Record + customData: any } export type HeadConfig =