-
Notifications
You must be signed in to change notification settings - Fork 922
/
page.ts
118 lines (100 loc) · 2.04 KB
/
page.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import type { MarkdownLink } from '@vuepress/markdown'
import type { PageData, PageFrontmatter } from '@vuepress/shared'
/**
* Vuepress Page
*/
export interface Page extends PageData {
/**
* Path of the page that inferred from file path
*
* If the page does not come from a file, it would be `null`
*
* @example '/guide/index.html'
*/
pathInferred: string | null
/**
* Locale path prefix of the page
*
* @example '/getting-started.html' -> '/'
* @example '/en/getting-started.html' -> '/en/'
* @example '/zh/getting-started.html' -> '/zh/'
*/
pathLocale: string
/**
* Absolute path of the source file
*
* If the page does not come from a file, it would be `null`
*/
filePath: string | null
/**
* Relative path of the source file
*
* If the page does not come from a file, it would be `null`
*/
filePathRelative: string | null
/**
* Component file path
*/
componentFilePath: string
/**
* Component relative file path
*/
componentFilePathRelative: string
/**
* Component file content that generated from the source file
*/
componentFileContent: string
/**
* Component file chunk name
*/
componentFileChunkName: string
/**
* Page data file path
*/
dataFilePath: string
/**
* Page data relative file path
*/
dataFilePathRelative: string
/**
* Page data file chunk name
*/
dataFileChunkName: string
/**
* Page routes file path
*/
routesFilePath: string
/**
* Page data relative file path
*/
routesFilePathRelative: string
/**
* Content of the page
*/
content: string
/**
* Links of the page
*/
links: MarkdownLink[]
/**
* Slug of the page
*/
slug: string
/**
* Date of the page, in 'yyyy-MM-dd' format
*
* @example '2020-09-09'
*/
date: string
}
/**
* Options to create vuepress page
*/
export interface PageOptions {
path?: string
filePath?: string
frontmatter?: PageFrontmatter
content?: string
permalink?: string
permalinkPattern?: string
}