【发布时间】:2019-04-15 04:04:32
【问题描述】:
我使用VuePress 和NetlifyCMS 作为内容管理。
我有 3 个集合(design、front-end 和 back-end),其中包含无限数量的页面。这些页面通过 NetlifyCMS 仪表板 创建并添加到定义的文件夹中。
- 新的设计页面被添加到 design 文件夹中。
- 新的前端页面被添加到 front-end 文件夹中。
- [...]
这很好用,但我遇到了一个问题。
由于我的新页面未在侧边栏配置中定义,因此无法从侧边栏界面中使用它们。在保持与下面相同的侧边栏格式的同时,我该如何做到这一点?
config.js
[...],
sidebar: {
'/design/': [{
title: 'Design',
children: [
'',
'foo 1',
'foo 2'
]
}],
'/front-end/': [{
title: 'Front-end',
children: [
'',
'bar 1',
'bar 2'
]
}],
'/back-end/': [{
title: 'Back-end',
children: [
'',
'baz 1',
'baz 2'
]
}]
},
[...]
config.yml
[...],
collections:
- name: "design"
label: "Design"
folder: "docs/design"
create: true
slug: "{{slug}}"
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Body", name: "body", widget: "markdown"}
- name: "front-end"
label: "Front-end"
folder: "docs/front-end"
create: true
slug: "{{slug}}"
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Body", name: "body", widget: "markdown"}
- name: "back-end"
label: "Back-end"
folder: "docs/back-end"
create: true
slug: "{{slug}}"
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Body", name: "body", widget: "markdown"}
【问题讨论】:
标签: vue.js vuejs2 netlify vuepress netlify-cms