Docpad - 从JSON文件中提取数据

时间:2013-08-31 00:30:39

标签: json coffeescript docpad

这是我的一段代码

<% for file in @getCollection("tumblrs").toJSON(): %>
<li>
<a href="<%= file.url %>"><%= file['title'] %></a>
</li>
<% end %>

这是我的数据集

{
"blog_name": "weface",
"id": 861340745,
"slug": "ssssaaawweeet",
"type": "text",
"date": "2010-07-26 13:28:07 GMT",
"timestamp": 1280150887,
"state": "published",
"format": "html",
"tags": [],
"highlighted": [],
"note_count": 0,
"title": "Ssssaaawweeet!",
}

我如何获得'头衔'?

0 个答案:

没有答案