mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
Add an option to allow overriding the site config.
This commit is contained in:
@@ -49,10 +49,21 @@ export default function logosPreset(
|
|||||||
path.join(__dirname, '../static', options.businessUnit),
|
path.join(__dirname, '../static', options.businessUnit),
|
||||||
)
|
)
|
||||||
|
|
||||||
context.siteConfig = _.merge(
|
if (!options.customSiteConfig)
|
||||||
context.siteConfig,
|
context.siteConfig = _.merge(
|
||||||
siteConfigs[options.businessUnit],
|
context.siteConfig,
|
||||||
)
|
siteConfigs[options.businessUnit],
|
||||||
|
)
|
||||||
|
else {
|
||||||
|
context.siteConfig.customFields = defaultsDeep(
|
||||||
|
[
|
||||||
|
{},
|
||||||
|
context.siteConfig.customFields,
|
||||||
|
siteConfigs[options.businessUnit].customFields ?? {},
|
||||||
|
],
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
context.siteConfig.themeConfig = defaultsDeep(
|
context.siteConfig.themeConfig = defaultsDeep(
|
||||||
[{}, context.siteConfig.themeConfig, themeConfigs[options.businessUnit]],
|
[{}, context.siteConfig.themeConfig, themeConfigs[options.businessUnit]],
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ export type PresetConfig = {
|
|||||||
name: ThemeNames.Default
|
name: ThemeNames.Default
|
||||||
options?: DefaultThemeOptions
|
options?: DefaultThemeOptions
|
||||||
}
|
}
|
||||||
|
customSiteConfig?: boolean
|
||||||
docs?: Partial<DocPluginOptions>
|
docs?: Partial<DocPluginOptions>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import { NavbarItem } from '@docusaurus/theme-common'
|
import { NavbarItem, Footer } from '@docusaurus/theme-common'
|
||||||
|
|
||||||
export type ThemeConfig = {
|
export type ThemeConfig = {
|
||||||
navbar?: {
|
navbar?: {
|
||||||
items?: NavbarItem[]
|
items?: NavbarItem[]
|
||||||
}
|
}
|
||||||
|
footer?: {
|
||||||
|
links?: Footer['links']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { PluginOptions as DefaultThemeOptions } from '@acid-info/logos-docusaurus-theme'
|
export type { PluginOptions as DefaultThemeOptions } from '@acid-info/logos-docusaurus-theme'
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const schema = Joi.object<PluginOptions>({
|
|||||||
})
|
})
|
||||||
.optional()
|
.optional()
|
||||||
.default({}),
|
.default({}),
|
||||||
|
customSiteConfig: Joi.boolean().optional().default(false),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const validateOptions = ({
|
export const validateOptions = ({
|
||||||
|
|||||||
Reference in New Issue
Block a user