Skip to content

Commit 0a9d26d

Browse files
authored
refactor(core): remove headers field from page data (#1613)
BREAKING CHANGE: the `headers` field has been removed from page data, but it's still available on page object
1 parent f674742 commit 0a9d26d

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

packages/core/src/page/createPage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export const createPage = async (
101101
title,
102102
lang,
103103
frontmatter,
104-
headers,
105104
},
106105

107106
// base fields

packages/core/src/types/page.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { MarkdownLink, MarkdownSfcBlocks } from '@vuepress/markdown'
2-
import type { PageBase, PageData, PageFrontmatter } from '@vuepress/shared'
2+
import type {
3+
PageBase,
4+
PageData,
5+
PageFrontmatter,
6+
PageHeader,
7+
} from '@vuepress/shared'
38

49
/**
510
* Vuepress Page
@@ -40,6 +45,11 @@ export type Page<
4045
*/
4146
deps: string[]
4247

48+
/**
49+
* Headers of the page
50+
*/
51+
headers: PageHeader[]
52+
4353
/**
4454
* Links of the page
4555
*/

packages/core/tests/page/createPage.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ describe('should work without plugins', () => {
3434
expect(page.data.lang).toBe('en-US')
3535
expect(page.data.title).toBe('')
3636
expect(page.data.frontmatter).toEqual({})
37-
expect(page.data.headers).toEqual([])
3837

3938
// base fields
4039
expect(page.path).toBe('/')

packages/shared/src/types/page.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ export interface PageBase<
3636
* Front matter of the page
3737
*/
3838
frontmatter: PageFrontmatter<ExtraPageFrontmatter>
39-
40-
/**
41-
* Headers of the page
42-
*/
43-
headers: PageHeader[]
4439
}
4540

4641
/**

0 commit comments

Comments
 (0)