雨果静态站点生成器不渲染数据模板
我正在尝试显示用户列表,该列表保存在 data/staff.json
[
{
"name":"John",
"email": "[email protected]"
},
{
"name":"Ringo",
"email": "[email protected]"
}
]
/code.md 中显示
{{ range .Site.Data.staff }}
<h2>{{ .name }}</h2>
<p>{{ .email }}</p>
{{end}}
中,该数据假设在 content/posts/staff.md.md < 我所能看到的原因是未读者代码
我重现了问题 on github上的源代码
>在实时演示上 通过列表和渲染? 雨果版本0.100.1(最新)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基于 hugo docs
在访问资源文件之前,您必须添加$符号
Based on Hugo docs
You have to add a $ sign before accessing resource file