Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core)!: remove headers field from page data #1613

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading