output directory structure in assemble

164 Views Asked by At

I am creating a static site using grunt.js and assemble. I have a data.json file used for building pages using assemble:

{
    "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/", 
        }, 

    ], 
}

I would like the output to be created in the following directories like this: 2014/oct/08/n-hook1/index.html. How can I create the directories in assemble?

Is this even possible with assemble.io? If there is something better, let me know. I am new to the js world and would like some direction. I did see this question but this seems to involve placing the files in different directories. Maybe I have to write a helper? If so, I am not sure where to start.

I like assemble because pages that are generated a completely upt o the client side rendering, and I just present the json data. Not sure if there is something better.

1

There are 1 best solutions below

0
On

The grunt-assemble-permalinks plugin was the solution, it does what I need.