如何使用cms创建新的Markdown VuePress

时间:2019-06-10 22:06:40

标签: javascript vue.js netlify vuepress

occupo netlify我遵循了本教程https://www.vuejsradar.com/vuepress-netlify-cms-integration/,这是我的存储库https://github.com/DanielJDA/handbook_Spot,我更改了本教程将是该存储库和config.yml文件的名称

backend:
  name: github
  repo: DanielJDA/handbook_Spot
  branch: master # Branch to update (optional; defaults to master)
media_folder: "docs/.vuepress/public/images"
public_folder: "docs/.vuepress/dist/"
collections:
  - name: "doc" # Used in routes, e.g., /admin/collections/blog
    label: "Doc" # Used in the UI
    folder: "docs" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
    fields: # The fields for each document, usually in front matter
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Body", name: "body", widget: "markdown"}

我的问题是当我进入管理员时,我创建了一个新文档并创建了该文档,但是它没有将其添加到菜单中,并且手册中也没有显示该文档,因此我必须发送它在这里调用config.js

module.exports = {
  title: 'Netlify CMS + VuePress',
  description: 'Netlify + VuePress',
  themeConfig: {
    docsDir: 'docs',
    repo: ' DanielJDA/handbook_Spot',
    sidebar: [
      '/',
      '/welcome',
      '/test'
    ],
    nav: [
      {
        text: 'Admin',
        link: '/admin/#/',
      }
    ]
  }
}

0 个答案:

没有答案