diff --git a/.changeset/fast-drinks-itch.md b/.changeset/fast-drinks-itch.md new file mode 100644 index 000000000..d5001d1b2 --- /dev/null +++ b/.changeset/fast-drinks-itch.md @@ -0,0 +1,5 @@ +--- +'@theguild/components': patch +--- + +exports `convertToPageMap`, `mergeMetaWithPageMap`, `normalizePageMap`, `evaluate` from nextra diff --git a/packages/components/src/server/index.ts b/packages/components/src/server/index.ts index ea186a635..ad75b93f9 100644 --- a/packages/components/src/server/index.ts +++ b/packages/components/src/server/index.ts @@ -5,7 +5,14 @@ export { MDXRemote } from 'nextra/mdx-remote'; export { fetchFilePathsFromGitHub } from 'nextra/fetch-filepaths-from-github'; export { compileMdx } from 'nextra/compile'; -export { getPageMap, createIndexPage } from 'nextra/page-map'; +export { + getPageMap, + createIndexPage, + convertToPageMap, + mergeMetaWithPageMap, + normalizePageMap, +} from 'nextra/page-map'; +export { evaluate } from 'nextra/evaluate'; export { fetchPackageInfo } from './npm.js'; export { sharedMetaItems } from './shared-meta-items'; diff --git a/packages/components/src/server/next.config.ts b/packages/components/src/server/next.config.ts index 286c14476..9897d8015 100644 --- a/packages/components/src/server/next.config.ts +++ b/packages/components/src/server/next.config.ts @@ -76,7 +76,7 @@ export const defaultNextraOptions: NextraConfig = { defaultShowCopyCode: true, whiteListTagsStyling: ['iframe', 'video', 'source'], search: { - codeblocks: true, + codeblocks: false, }, mdxOptions: { // Check front matter only in production (when Webpack is used) diff --git a/packages/components/src/server/theme-layout.tsx b/packages/components/src/server/theme-layout.tsx index 73a7c8b93..d3fccb8ac 100644 --- a/packages/components/src/server/theme-layout.tsx +++ b/packages/components/src/server/theme-layout.tsx @@ -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'; @@ -72,6 +73,7 @@ export const GuildLayout: FC<{ * Nextra's Docs Theme `` component props */ navbarProps: NavbarProps; + pageMap?: PageMapItem[]; }> = async ({ children, websiteName, @@ -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 = [ {