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