Skip to content

Commit

Permalink
add optional pageMap for guild layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Dec 18, 2024
1 parent eefc0d1 commit e56d838
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/components/src/server/theme-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentProps, FC, ReactNode } from 'react';
import { Metadata } from 'next';
import { PageMapItem } from 'nextra';
import { Layout, Navbar } from 'nextra-theme-docs';
import { Head } from 'nextra/components';
import { getPageMap } from 'nextra/page-map';
Expand Down Expand Up @@ -72,6 +73,7 @@ export const GuildLayout: FC<{
* Nextra's Docs Theme `<Navbar>` component props
*/
navbarProps: NavbarProps;
pageMap?: PageMapItem[];
}> = async ({
children,
websiteName,
Expand All @@ -81,8 +83,9 @@ export const GuildLayout: FC<{
logo,
layoutProps,
navbarProps,
...props
}) => {
const [meta, ...pageMap] = await getPageMap();
const [meta, ...pageMap] = props.pageMap || (await getPageMap());

const pageMapWithCompanyMenu = [
{
Expand Down

0 comments on commit e56d838

Please sign in to comment.