我正在尝试将 Netlify CMS 集成到 Academic Hugo 主题中。我想构建一个 config.yml,其中包含用于发布、讨论等的集合。我的问题与此类似。我能够配置每篇文章的一些字段,但我无法包含 [] 中的变量:
+++
title = "Academic: the website designer for Hugo"
date = 2016-04-20T00:00:00
lastmod = 2018-01-13T00:00:00
draft = false
tags = ["academic"]
summary = "Create a beautifully simple website or blog in under 10 minutes."
[header]
image = "headers/getting-started.png"
caption = "Image credit: [**Academic**](https://github.com/gcushen/hugo-
academic/)"
[[gallery_item]]
album = "1"
image = "https://raw.githubusercontent.com/gcushen/hugo-
academic/master/images/theme-default.png"
caption = "Default"
+++
请问,任何 config.yml 都可以输出这种 md 吗?
非常感谢你的帮助!
更新:
最后我能够做到这一点,这是我遇到问题的另一种情况:
+++
# About/Biography widget.
widget = "about"
active = true
date = 2016-04-20T00:00:00
# Order that this section will appear in.
weight = 5
# List your academic interests.
[interests]
interests = [
"Artificial Intelligence",
"Computational Linguistics",
"Information Retrieval"
]
# List your qualifications (such as academic degrees).
[[education.courses]]
course = "PhD in Artificial Intelligence"
institution = "Stanford University"
year = 2012
[[education.courses]]
course = "MEng in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2009
[[education.courses]]
course = "BSc in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2008
+++
如果它可以帮助某人,这里的解决方案:
- file: "content/home/about.md"
label: "About"
name: "about"
fields:
- {label: "Widget (Don't modify)", name: "widget", widget: "string", default: "about"}
- {label: "Active", name: "active", widget: "boolean", default: true }
- {label: "Date", name: "date", widget: "datetime" }
- {label: "Weight", name: weight, default: 5}
- {label: "Interests", name: interests, widget: object, fields: [
{label: "Interests list", name: "interests", widget: "list",
default: ["Artificial Intelligence"]}]}
- {label: "Education", name: "education", widget: "object", fields: [
{label: "courses", name: "courses", widget: "list", fields: [
{label: Course, name: course , widget: string},
{label: Institution, name: institution, widget: string},
{label: Year, name: year, default: 2010}]}]}
- { label: "Body", name: "body", widget: "markdown", required: false }
非常感谢!