【问题标题】:Make multilingual content folder template for Hugo with Netlify CMS使用 Netlify CMS 为 Hugo 制作多语言内容文件夹模板
【发布时间】:2020-08-21 05:49:08
【问题描述】:

关于如何为内容页面提供服务的 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"}

【问题讨论】:

    标签: netlify hugo netlify-cms jamstack


    【解决方案1】:

    发现它就像添加更长的路径和标题(例如文件夹/子文件夹)一样简单。可能看起来很明显,但如果您像我一样没有使用 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"})```
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-06
      • 1970-01-01
      • 2023-03-08
      • 2018-06-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多