1
我有一个json数据文件,其中包含具有指定键的多个对象。使用Metalsmith和swig访问模型中的单个对象
{
"berlin:" : {
"location": "Berlin",
"folder": "berlin-2016"
},
"seattle" : {
"location": "Seattle ",
"folder": "seattle-2016"
}
}
在我的内容文件中,我想指定要使用的模型中的哪个对象,然后在swig中引用该对象。类似这样的:
---
model:
conference: conferences['berlin']
---
{{ model.conference.location }}
这可能吗?
您可以使用自定义插件做你想做的事。 – Luksprog