yaml - 在 yaml 文件中添加相同变量名的数组
问题描述
对于这个网站,它从 authors.Yaml 文件中获取信息。
此文件包含演示作者的详细信息。
authors:
- slug: wutali
name: Takahiro Fujiwara
introduction:
Co-founder and CTO at Fuller, Inc. / Software & Data Engineer /
Python / Golang / React
但是,我想输入我的信息。
- slug: Hemming
name: Alexander Hemming
introduction:
Developer, React, Node, Sveltekit, Goland.
- slug: Owner
name: John Doe
introduction:
Founder and CEO at a company.
将此添加到末尾似乎不起作用。我如何使其他潜在作者可以访问此信息?
解决方案
您有两个缩进错误:
- slug: Hemming
name: Alexander Hemming
introduction:
Developer, React, Node, Sveltekit, Goland.
- slug: Owner # fixed indentation to be on par with previous item
name: John Doe
introduction: # next line must be more indented to be the value
# of this key.
Founder and CEO at a company.
推荐阅读
- python - 通过恰好替换一个字符使字符串在字典上最小且非回文
- r - 在 r 中按特定列分组的不同行中过滤/搜索
- javascript - 无法读取未定义的属性“日期” - 仅当 FlatList
- conda - Conda 安装 pydup 失败
- android-studio - Android Studio 4.1 边框按钮在 kotlin 代码中丢失边框设置背景颜色
- mybatis - Mybatis @Insert 注解 Mysql 和 H2 - 需要一种方法来使用 Point for mysql 和 ST_Point for H2
- python - 如何在 Holoviews 中取消链接 Panel 对象的轴
- django - AWS copilot 与 Django 从未完成部署
- xhtml - (n) 将 DTD 文档转换为 Xhtml 文档 + 通过验证器 W3c?
- javascript - 如何将数据放在单行中以获取 2 个标题标签 html