ele
ele

Reputation: 6181

Dropping a directory from 'src' to 'dest' paths in Grunt.js and Assemble

I'm trying to take source files from pages/*.hbs and get them into the root of the build directory. Currently, they're ending up in build/pages/*.html.

Here's my task config. I tried looking into Grunt's task configuration options but wasn't getting any luck.

    assemble: {
        options: {
            layout: 'layouts/default.hbs'
        },
        pages: {
            src: ['pages/*.hbs'],
            dest: 'build/'
        }

Upvotes: 3

Views: 139

Answers (1)

Evan Davis
Evan Davis

Reputation: 36592

You need expand: true which enables extra options, along with cwd which allows you to specify but not include part of your src path.

assemble: {
    options: {
        layout: 'layouts/default.hbs'
    },
    pages: {
        expand: true,
        cwd: 'pages'
        src: ['*.hbs'],
        dest: 'build/'
    }

Building the Files object dynamically

Upvotes: 2

Related Questions