File tree 1 file changed +10
-1
lines changed
packages/@vuepress/core/lib/prepare
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 9
9
fs,
10
10
path,
11
11
hash,
12
+ chalk,
13
+ logger,
12
14
slugify,
13
15
inferTitle,
14
16
fileToPath,
@@ -43,14 +45,15 @@ module.exports = class Page {
43
45
permalink,
44
46
frontmatter = { } ,
45
47
permalinkPattern
46
- } ) {
48
+ } , context ) {
47
49
this . title = title
48
50
this . _meta = meta
49
51
this . _filePath = filePath
50
52
this . _content = content
51
53
this . _permalink = permalink
52
54
this . frontmatter = frontmatter
53
55
this . _permalinkPattern = permalinkPattern
56
+ this . _context = context
54
57
55
58
if ( relative ) {
56
59
this . regularPath = encodeURI ( fileToPath ( relative ) )
@@ -82,7 +85,13 @@ module.exports = class Page {
82
85
preRender = { }
83
86
} ) {
84
87
if ( this . _filePath ) {
88
+ logger . developer ( `static_route` , chalk . cyan ( this . path ) )
85
89
this . _content = await fs . readFile ( this . _filePath , 'utf-8' )
90
+ } else if ( this . _content ) {
91
+ logger . developer ( `static_route` , chalk . cyan ( this . path ) )
92
+ this . _filePath = await this . _context . writeTemp ( `temp-pages/${ this . key } .md` , this . _content )
93
+ } else {
94
+ logger . developer ( `dynamic_route` , chalk . cyan ( this . path ) )
86
95
}
87
96
88
97
if ( this . _content ) {
You can’t perform that action at this time.
0 commit comments