feat: support docusaurus's default theme

This commit is contained in:
Hossein Mehrabi
2023-03-17 14:25:04 +03:30
parent 8244c0052c
commit 46fea42c0d
2 changed files with 19 additions and 12 deletions
@@ -78,14 +78,15 @@ export default function logosPreset(
plugins.push('docusaurus-plugin-sass')
plugins.push(
// changing the order of plugins passed to makeSearchPluginConfig function
// may cause the search plugin to skip indexing some pages.
...makeSearchPluginConfig(
[...plugins, ...context.siteConfig.plugins],
options,
),
)
if (options.theme?.name !== ThemeNames.DocusaurusDefault)
plugins.push(
// changing the order of plugins passed to makeSearchPluginConfig function
// may cause the search plugin to skip indexing some pages.
...makeSearchPluginConfig(
[...plugins, ...context.siteConfig.plugins],
options,
),
)
if (options.theme?.name === ThemeNames.Default)
themes.push([
@@ -3,6 +3,7 @@ import { DefaultThemeOptions } from './themes'
export enum ThemeNames {
Default = 'default',
DocusaurusDefault = 'docusaurus-default',
}
export enum BusinessUnits {
@@ -28,10 +29,15 @@ export type ContactInfo = Contact[]
export type PresetConfig = {
businessUnit: BusinessUnits
contactInfo?: string
theme?: {
name: ThemeNames.Default
options?: DefaultThemeOptions
}
theme?:
| {
name: ThemeNames.Default
options?: DefaultThemeOptions
}
| {
name: ThemeNames.DocusaurusDefault
options?: DefaultThemeOptions
}
customSiteConfig?: boolean
docs?: Partial<DocPluginOptions>
}