javascript - pass middleman variable to grunt file -
my middleman template has 'id' variable put html emails job name into.
i know if change middleman erb file index.html.erb newname.html.erb output final files name.
my problem of grunt tasks require file name want them run on (i've tried using *.html, works tasks) , short of editing in grunt file prior starting grunt won't execute if change erb file name.
is there way pass grunt 'id' variable name file middleman outputting , plug variable various tasks accept filename?
here grunt config:
grunt.initconfig({ pkg: grunt.file.readjson('package.json'), // build html middleman: { options: { usebundle: true }, server: {}, build: { options: { command: "build" } } }, // format html file prettify: { options: { // task-specific options go here. }, one: { src: 'build/index.html', dest: '_output/index.html' } }, // run text converter execute: { simple_target_with_args: { options: { // execute node additional arguments args: ['_output/index.html'] }, src: ['node_modules/node-text-converter/converter.js'] } }, 'special-html': { compile: { files: { '_output/index.html': '_output/index.html', } } }, 'phantomjs_screenshot': { main: { options: { delay: 1000 }, files: [{ expand: true, cwd: '_output', src: ['**/*.html'], dest: '_output/screenshots/', ext: '.jpg' }] } } });
you should store variable in json file , import both middleman , grunt.
Comments
Post a Comment