简体   繁体   中英

Multiple output extensions in assemble

I have a grunt file like this (part of the assemble config):

pages: {
    files: [{expand: true,
      cwd: 'src/pages/',
      src: '**/*.hbs',
      dest: 'dist/',
      ext: '.html'
    }]
  }

This way it takes every hbs file and renderes them with html extension. Is it possible to have a css file in the same folder as the .hbs file, and that assemble moves it to the same folder as the compiled html file.

To explain some more, i want every file other than .hbs files to just be moved to the same location as the compiled hbs file. Is this possible with Assemble?

I solved it with another Grunt plugin, the grunt-contrib-copy and this task:

copy: {
  main: {
    files: [ 
      {expand: true, cwd: 'src/pages/', src: ['**', '!**/*.hbs'], dest: 'dist/', filter: 'isFile'}
    ]
  }
},

This way it copies every file other than hbs files to the same folders as assemble generates the html-files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM