Skip to content

Commit

Permalink
feat(core)!: remove headers field from page data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Oct 9, 2024
1 parent eaa97e6 commit 9de9b7f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/core/src/page/createPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export const createPage = async (
title,
lang,
frontmatter,
headers,
},

// base fields
Expand Down
12 changes: 11 additions & 1 deletion packages/core/src/types/page.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -40,6 +45,11 @@ export type Page<
*/
deps: string[]

/**
* Headers of the page
*/
headers: PageHeader[]

/**
* Links of the page
*/
Expand Down
1 change: 0 additions & 1 deletion packages/core/tests/page/createPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('/')
Expand Down
5 changes: 0 additions & 5 deletions packages/shared/src/types/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ export interface PageBase<
* Front matter of the page
*/
frontmatter: PageFrontmatter<ExtraPageFrontmatter>

/**
* Headers of the page
*/
headers: PageHeader[]
}

/**
Expand Down

0 comments on commit 9de9b7f

Please sign in to comment.