首页 > 解决方案 > 从 netlify cms 采购

问题描述

我按照盖茨比网站上的教程进行操作。我正在运行“hello world” https://admiring-bose-8807f8.netlify.com/站点。我创建了一个帖子,但坚持让它显示。我正在使用 gatsby-source-filesystem 插件。我的 gatsby-config.js 文件如下:

module.exports = {
  /* Your site config here */
  plugins: [
    `gatsby-plugin-netlify-cms`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `blog`,
        path: `${__dirname}/blog`
      },
    },
    `gatsby-transformer-remark`,
    ]
}

我的 config.yml 是

backend:
  name: github
  repo: jamesgrubb/Gatsbycms

media_folder: static/assets
public_folder: assets

collections:
  - name: blog
    label: Blog
    folder: blog
    create: true
    fields:
      - { name: path, label: Path }
      - { name: date, label: Date, widget: date }
      - { name: title, label: Title }
      - { name: body, label: Body, widget: markdown }

当我进入管理员并单击以创建新帖子时,我有以下文件

我输入了以下字符串:

我应该如何格式化我的 URL?我试过了: https ://admiring-bose-8807f8.netlify.com/blog/first-blog/Title

没有快乐?

有任何想法吗

标签: gatsbynetlify-cms

解决方案


我在 github 上查看了你的 repo,我认为你错过了必须查询 markdown 文件然后将它们呈现在gatsby-node.js. 查看此官方教程或查看官方博客入门源


推荐阅读