0.1.2 • Published 8 years ago

grunt-ejs-template v0.1.2

Weekly downloads
5
License
-
Repository
github
Last release
8 years ago

grunt-ejs-template

A grunt plugin for rendering ejs templates

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-ejs-template --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-ejs-template');

The "ejs_template" task

Usage Example

grunt.initConfig({

  ejs_template: {

    main: {
      options: {
        // where to find your 'includes' using absolute paths
        root: './templates/includes',
        globals: {
          title: 'Home Page'
        },
      },
      files: [{
        expand: true,
        cwd: './tempates',
        src: ['**/*.ejs', '!includes/**/*'],
        dest: './dist',
        ext: '.html'
      }]
    }
  }

});

Options

options

Type: Object Default value: {}

Any valid EJS option https://github.com/mde/ejs#options.

options.globals

Type: Object Default value: {}

A hash containing the global variables/data for the template.

Release History

  • 0.1.2 usage example update
  • 0.1.0 first release
0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago