【问题标题】:Sourcing from netlify cms从 netlify cms 采购
【发布时间】:2019-11-02 15:40:39
【问题描述】:

我按照 Gatsby 网站上的教程进行操作。我正在运行“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 }

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

  • 路径
  • 日期
  • 标题
  • 身体

我输入了以下字符串:

  • 路径:/first-blog/
  • 日期:(预填)
  • 标题:标题
  • 身体:Lorem ipsum

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

不开心?

任何想法

【问题讨论】:

    标签: gatsby netlify-cms


    【解决方案1】:

    我在 github 上查看了你的 repo,我认为你错过了必须查询 markdown 文件然后在 gatsby-node.js 中呈现它们的部分。查看official tutorial 或查看official blog starter source

    【讨论】:

      猜你喜欢
      • 2019-08-06
      • 2020-07-18
      • 1970-01-01
      • 2011-12-25
      • 2018-06-30
      • 2019-02-23
      • 2021-07-01
      • 1970-01-01
      • 2019-04-18
      相关资源
      最近更新 更多