NetlifyCms不会在jekyll站点中保存新的集合对象

时间:2019-03-16 00:01:17

标签: jekyll netlify-cms

我有一些自定义收藏夹,这些收藏夹可以正常工作并保存得很好。我添加了一个新的(customtags),由于某种原因,我尝试使用netlifycms进行的任何配置都不会保存新实例。我可以编辑已经手动创建的现有文件,但不会创建新文件。

customcollections / _customtags文件夹存在。

如果我手动创建markdown文件,然后netlify拾取它们并且可以编辑它们,那么我也可以根据netlify配置选择这些customtag作为与navtiles自定义集合的关系。

有人有什么主意吗?

Netlify配置:

  backend:
  name: git-gateway
  branch: master # Branch to update (optional; defaults to master)

# This line should *not* be indented
media_folder: "images/uploads" # Media files will be stored in the repo under images/uploads
collections:
  - name: "posts"
    label: "Posts"
    folder: "customcollections/_posts"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
    fields:
      - {label: "Layout", name: "layout", widget: "hidden", default: "post"}
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Featured Image", name: "image", widget: "image"}
      - {label: "Body", name: "body", widget: "markdown"}
#      - {label: "Categories", name: "categories", widget: "list"}
  - name: "navtiles"
    label: "Navigation Tiles"
    folder: "customcollections/_navtiles"
    create: true
    fields:
      - {label: "Layout", name: "layout", widget: "hidden", default: "navtile"}
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Image", name: "image", widget: "image"}
      - {label: "Body", name: "body", widget: "markdown"}
      - {label: "Url", name: "url", widget: "string"}
      - {label: "Tags", name: "tags", widget: "relation", collection: "customtags", displayFields: ["tag"], searchFields: ["tag"],  valueField: "tag",  multiple: true}
  - name: "customtags"
    label: "Tags"
    folder: "customcollections/_customtags"
    create: true
    fields: 
      - {label: "tag", name: "tag", widget: "string"}
  - name: "bannerslides"
    label: "Banner Slides"
    folder: "customcollections/_bannerslides"
    create: true
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Image", name: "image", widget: "image"}
      - {label: "Body", name: "body", widget: "markdown"}
      - {label: "Url", name: "url", widget: "string"}

现有的jekyllconfig

    # Site settings
title: CSAcup
tagline: This is the tagline
description: > # this means to ignore newlines until "baseurl:"
  Write an awesome description for your new site here. You can edit this
  line in _config.yml. It will appear in your document head meta (for
  Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://dev.clearspringacupuncture.co.uk" # the base hostname & protocol for your site

# Plugins
plugins: ["jekyll-paginate"]

# Build settings
markdown: kramdown
sass:
  sass_dir: assets/sass

# Pagination
paginate: 4
paginate_path: "/blog/page:num/"


collections_dir: customcollections

collections:
    posts:
        output: true
    navtiles:
        output: false
    bannerslides:
        output: false
    posttiles:
        output: false
    features:
        output: false
    customtags:
        output: false

0 个答案:

没有答案