Skip to content

Commit

Permalink
fix: πŸ› fix init error
Browse files Browse the repository at this point in the history
  • Loading branch information
huyikai committed Dec 20, 2023
1 parent b98cf47 commit a84f7f9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/@huyikai/vitepress-helper/src/init.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetchAllPages from './pages';
import locales from './locales';
import nav from './nav';
import sidebar from './sidebar';
import fetchAllPages from "./pages";
import locales from "./locales";
import nav from "./nav";
import sidebar from "./sidebar";

export default async (params: any) => {
const pages: any = await fetchAllPages(params);
Expand All @@ -10,8 +10,8 @@ export default async (params: any) => {
const themeConfig = params?.themeConfig
? {
...params?.themeConfig,
nav: [...nav(baseParams), ...params?.themeConfig?.nav],
sidebar: sidebar(baseParams)
nav: [...nav(baseParams), ...(params?.themeConfig?.nav || [])],
sidebar: sidebar(baseParams),
}
: undefined;
return {
Expand All @@ -20,6 +20,6 @@ export default async (params: any) => {
pages: pages.basePages,
...params,
themeConfig,
locales: locales(localesParams)
locales: locales(localesParams),
};
};

0 comments on commit a84f7f9

Please sign in to comment.