我正在使用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 / oct / 08 / n-hook1 / index.html。如何在汇编中创建目录?
甚至可以使用assemble.io吗?如果有更好的东西,请告诉我。我是js世界的新手,想要一些方向。我确实看到this question但这似乎涉及将文件放在不同的目录中。也许我必须写一个帮手?如果是这样,我不知道从哪里开始。
我喜欢汇编,因为生成的页面完全在客户端渲染上升,我只是呈现json数据。不确定是否有更好的东西。