-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move setting
pageMap
items' title
property from normalizePages
…
…to `sortFolder` (#4166) * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd snapshots
- Loading branch information
1 parent
b46d831
commit 7949e28
Showing
27 changed files
with
371 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"nextra": patch | ||
--- | ||
|
||
move setting `pageMap` items' `title` property from `normalizePages` to `sortFolder` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/nextra/src/server/__tests__/fixture/page-maps/title/1-meta.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const metadata = { | ||
sidebarTitle: 'from sidebarTitle', | ||
title: 'from title' | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/nextra/src/server/__tests__/fixture/page-maps/title/2-sidebar-title.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const metadata = { | ||
sidebarTitle: 'from sidebarTitle', | ||
title: 'from title' | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/nextra/src/server/__tests__/fixture/page-maps/title/3-title.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const metadata = { | ||
title: 'from title' | ||
} |
Empty file.
15 changes: 15 additions & 0 deletions
15
packages/nextra/src/server/__tests__/fixture/page-maps/title/_meta.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
_: { | ||
type: 'separator' | ||
}, | ||
folder: 'from meta', | ||
'folder-with-index': '', | ||
'1-meta': 'from meta', | ||
'2-sidebar-title': '', | ||
'3-title': '', | ||
'4-from-filename': '', | ||
_2: { | ||
type: 'separator', | ||
title: 'separator with title' | ||
} | ||
} |
Empty file.
5 changes: 5 additions & 0 deletions
5
...nextra/src/server/__tests__/fixture/page-maps/title/folder-with-index/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const metadata = { | ||
asIndexPage: true, | ||
sidebarTitle: 'from sidebarTitle', | ||
title: 'from title' | ||
} |
Empty file.
Empty file.
67 changes: 67 additions & 0 deletions
67
packages/nextra/src/server/__tests__/fixture/page-maps/title/generated-page-map.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// @ts-nocheck | ||
import { normalizePageMap } from 'nextra/page-map' | ||
|
||
import meta from "./_meta.ts"; | ||
import {metadata as _1_meta} from "./1-meta.mdx?metadata"; | ||
import {metadata as _2_sidebar_title} from "./2-sidebar-title.mdx?metadata"; | ||
import {metadata as _3_title} from "./3-title.mdx?metadata"; | ||
import {metadata as _4_from_filename} from "./4-from-filename.mdx?metadata"; | ||
import {metadata as folder_with_index_foo} from "./folder-with-index/foo.mdx?metadata"; | ||
import {metadata as folder_with_index_index} from "./folder-with-index/index.mdx?metadata"; | ||
import {metadata as folder_bar} from "./folder/bar.mdx?metadata"; | ||
import {metadata as folder_index} from "./folder/index.mdx?metadata"; | ||
|
||
export const pageMap = normalizePageMap([{ | ||
data: meta | ||
}, { | ||
name: "1-meta", | ||
route: "/1-meta", | ||
frontMatter: _1_meta | ||
}, { | ||
name: "2-sidebar-title", | ||
route: "/2-sidebar-title", | ||
frontMatter: _2_sidebar_title | ||
}, { | ||
name: "3-title", | ||
route: "/3-title", | ||
frontMatter: _3_title | ||
}, { | ||
name: "4-from-filename", | ||
route: "/4-from-filename", | ||
frontMatter: _4_from_filename | ||
}, { | ||
name: "folder-with-index", | ||
route: "/folder-with-index", | ||
children: [{ | ||
name: "foo", | ||
route: "/folder-with-index/foo", | ||
frontMatter: folder_with_index_foo | ||
}, { | ||
name: "index", | ||
route: "/folder-with-index", | ||
frontMatter: folder_with_index_index | ||
}] | ||
}, { | ||
name: "folder", | ||
route: "/folder", | ||
children: [{ | ||
name: "bar", | ||
route: "/folder/bar", | ||
frontMatter: folder_bar | ||
}, { | ||
name: "index", | ||
route: "/folder", | ||
frontMatter: folder_index | ||
}] | ||
}]) | ||
|
||
export const RouteToFilepath = { | ||
"1-meta": "1-meta.mdx", | ||
"2-sidebar-title": "2-sidebar-title.mdx", | ||
"3-title": "3-title.mdx", | ||
"4-from-filename": "4-from-filename.mdx", | ||
"folder-with-index/foo": "folder-with-index/foo.mdx", | ||
"folder-with-index": "folder-with-index/index.mdx", | ||
"folder/bar": "folder/bar.mdx", | ||
"folder": "folder/index.mdx" | ||
} |
Oops, something went wrong.