Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Jan 25, 2025
1 parent 20f7aaa commit e016133
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/giant-garlics-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"nextra": patch
"nextra-theme-blog": patch
"nextra-theme-docs": patch
---

fix regression from Nextra 3 setting [`theme.collapsed?: boolean` in `_meta` file](https://nextra.site/docs/file-conventions/meta-file#theme-option) for folders has no effect in sidebar
4 changes: 2 additions & 2 deletions docs/app/docs/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ project. If you have a question that isn't answered here, please

<details>
<summary className="mb-2">Can I use X with Nextra?</summary>
The answer is "yes" for most things. Since Nextra is just a Next.js plugin, almost all the things
that can be done with React can be done with Nextra. Here are some examples and guides:
The answer is "yes" for most things. Since Nextra is just a Next.js plugin, almost all the things
that can be done with React can be done with Nextra. Here are some examples and guides:

- [Use Tailwind CSS](/docs/guide/tailwind-css)
- [Use custom CSS and Sass](/docs/guide/custom-css)
Expand Down
9 changes: 8 additions & 1 deletion packages/nextra/src/client/normalize-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Folder, FrontMatter, MdxFile, PageMapItem } from '../types.js'

const DEFAULT_PAGE_THEME: PageTheme = {
breadcrumb: true,
collapsed: false,
collapsed: undefined,
footer: true,
layout: 'default',
navbar: true,
Expand Down Expand Up @@ -177,6 +177,13 @@ export function normalizePages({
})
const item: Item = getItem()
const docsItem: DocsItem = getItem()
if ('children' in docsItem) {
const { collapsed } = extendedMeta.theme
if (typeof collapsed === 'boolean') {
// @ts-expect-error -- fixme
docsItem.theme = { collapsed }
}
}
const pageItem: PageItem = getItem()

docsItem.isUnderCurrentDocsTree = underCurrentDocsRoot
Expand Down

0 comments on commit e016133

Please sign in to comment.