Skip to content

Commit 0790fb6

Browse files
committed
feat: support frontmatter
1 parent 28538ad commit 0790fb6

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

packages/scripts/src/conf/getPrerenderRoutes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const getPrerenderRoutes = (cmd) => {
1414
path,
1515
options: otherProps,
1616
}))
17+
console.log('dirTree12345', dirTree)
1718
const result = getPrerenderRoute(dirTree)
1819
result.push('/404')
1920
// console.log('✅ prerender', result)

packages/scripts/src/conf/node-directory-tree.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ function directoryTree({
7676
item.type = constants.FILE
7777
const contentStr = fs.readFileSync(path).toString()
7878
if (contentStr && !options.prerender) {
79+
// todo: when yarn build not run here.
80+
item.test = 'test'
7981
const contentMatch = contentStr.match(/^<!--([^>]*)-->/)
8082
item.relative = item.path.replace(process.cwd(), '')
8183
item.mdconf = contentMatch ? YAML.parse(contentMatch[1]) : {}

packages/scripts/src/conf/webpack.config.prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ module.exports = function (cmd) {
171171
// routes,
172172
routes: [
173173
'/README', '/快速上手',
174-
'/hijkl', '/mnopq',
175-
'/404'
174+
'/290a4219', '/9f41fc98',
175+
'/f55182c5'
176176
],
177177
successCb: async () => {
178178
if (docsConfig.repo) {

0 commit comments

Comments
 (0)