0
我正在使用grunt.js和assemble创建一个静态站点。我有用于使用组装构建页面data.json文件:汇编中的输出目录结构
{
"articles": [
{
"author": "Brian",
"headline": "A Generation on the Hook 1",
"body": "cars, and start businesses by means of debt",
"slug" : "n-hook1",
"publish_on": "2014-10-10T04:00:00+00:00",
"url": "http://example.com/2014/oct/08/n-hook1/",
},
{
"author": "Brian",
"headline": "A Generation on the Hook 2",
"body": "As millions go to college, buy homes,",
"slug" : "n-hook2",
"publish_on": "2014-10-12T04:00:00+00:00",
"url": "http://example.com/2014/oct/08/n-hook2/",
},
],
}
我想在以下目录中创建输出这样的日期:2014年/月/ 08 /正hook1/index.html的。我如何在汇编中创建目录?
这甚至有可能与assemble.io?如果有更好的东西,让我知道。我对js世界很陌生,想要一些方向。我确实看到this question,但这似乎涉及将文件放在不同的目录中。也许我必须写一个帮手?如果是这样,我不知道从哪里开始。
我喜欢组装,因为生成的页面完全在客户端渲染,而我只是呈现json数据。不确定是否有更好的东西。