Removing a directory from the paths 'src' to 'dest' in Grunt.js and assembly

I am trying to take the source files from pages/*.hbsand get them in the root directory build. They are currently ending with build/pages/*.html.

Here is my config task. I tried to look at the Grunt task settings , but it didn’t work.

    assemble: {
        options: {
            layout: 'layouts/default.hbs'
        },
        pages: {
            src: ['pages/*.hbs'],
            dest: 'build/'
        }
+3
source share
1 answer

You will need expand: trueone that includes additional options, as well as cwdone that allows you to specify, but not include part of your path src.

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

Dynamically build a Files object

+2
source

All Articles