Skip to content

Commit cb36ae6

Browse files
committed
feat($core): support passing in meta
1 parent 1798603 commit cb36ae6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/@vuepress/core/lib/internal-plugins/routes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ function routesCode (pages) {
3333
function genRoute ({
3434
path: pagePath,
3535
key: componentName,
36-
regularPath
36+
regularPath,
37+
_meta
3738
}) {
3839
let code = `
3940
{
4041
name: ${JSON.stringify(componentName)},
4142
path: ${JSON.stringify(pagePath)},
42-
component: LayoutDistributor,
43+
component: LayoutDistributor,${_meta ? `\n meta: ${JSON.stringify(_meta)}` : ''}
4344
}`
4445

4546
const dncodedPath = decodeURIComponent(pagePath)

packages/@vuepress/core/lib/prepare/Page.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = class Page {
1515
*/
1616
constructor ({
1717
path,
18+
meta,
1819
title,
1920
content,
2021
filePath,
@@ -24,6 +25,7 @@ module.exports = class Page {
2425
permalinkPattern
2526
}) {
2627
this.title = title
28+
this._meta = meta
2729
this._filePath = filePath
2830
this._content = content
2931
this._permalink = permalink

0 commit comments

Comments
 (0)