diff --git a/packages/core/src/page/createPage.ts b/packages/core/src/page/createPage.ts index 2e9946dec2..aed67e2aec 100644 --- a/packages/core/src/page/createPage.ts +++ b/packages/core/src/page/createPage.ts @@ -101,7 +101,6 @@ export const createPage = async ( title, lang, frontmatter, - headers, }, // base fields diff --git a/packages/core/src/types/page.ts b/packages/core/src/types/page.ts index 0532d3d594..ce2cb36e92 100644 --- a/packages/core/src/types/page.ts +++ b/packages/core/src/types/page.ts @@ -1,5 +1,10 @@ import type { MarkdownLink, MarkdownSfcBlocks } from '@vuepress/markdown' -import type { PageBase, PageData, PageFrontmatter } from '@vuepress/shared' +import type { + PageBase, + PageData, + PageFrontmatter, + PageHeader, +} from '@vuepress/shared' /** * Vuepress Page @@ -40,6 +45,11 @@ export type Page< */ deps: string[] + /** + * Headers of the page + */ + headers: PageHeader[] + /** * Links of the page */ diff --git a/packages/core/tests/page/createPage.spec.ts b/packages/core/tests/page/createPage.spec.ts index 313fed3876..bb9bfedeea 100644 --- a/packages/core/tests/page/createPage.spec.ts +++ b/packages/core/tests/page/createPage.spec.ts @@ -34,7 +34,6 @@ describe('should work without plugins', () => { expect(page.data.lang).toBe('en-US') expect(page.data.title).toBe('') expect(page.data.frontmatter).toEqual({}) - expect(page.data.headers).toEqual([]) // base fields expect(page.path).toBe('/') diff --git a/packages/shared/src/types/page.ts b/packages/shared/src/types/page.ts index a1d05f2372..cde6f1e052 100644 --- a/packages/shared/src/types/page.ts +++ b/packages/shared/src/types/page.ts @@ -36,11 +36,6 @@ export interface PageBase< * Front matter of the page */ frontmatter: PageFrontmatter - - /** - * Headers of the page - */ - headers: PageHeader[] } /**