0

关于如何为服务于内容页面的 Netlify CMS 模板制作更深的子文件夹结构的任何想法。是否可以使用 Netlify CMS config.yml 模板来完成。

这就是我目前所拥有的:

/内容/主题文件夹/主题部分文件夹/语言文件.md

雨果结构

目前我有这个

backend:
  name: git-gateway
  branch: master
media_folder: static/img
public_folder: /img
collections:
  - name: "about"
    label: "About"
    folder: "content/about"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:d
      - {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
      - {label: "Title", name: "title", widget: "string"}
      - {label: 'URL', name: 'URL', widget: 'string' }
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Featured Image", name: "thumbnail", widget: "image"}
      - {label: "Body", name: "body", widget: "markdown"}
4

1 回答 1

0

发现它就像添加更长的路径和标题一样简单,例如文件夹/子文件夹。可能看起来很明显,但如果您像我一样没有使用 Hugo 和 Netlify CMS 的经验,那么这就是我的案例中的诀窍:

collections:
  - name: "about" # Used in routes, e.g., /admin/collections/blog
    label: "About / Forum" # Used in the UI
    folder: "content/about/forum" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
    fields: # The fields for each document, usually in front matter
      - {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
      - {label: "Title", name: "title", widget: "string"})```
于 2020-08-21T06:22:22.793 回答