Getting Started
npm install grunt-art-template --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
Template task
Run this task with the grunt template
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Options
root
Type: String
Default: /
template root directory. If the filename field is not a local path, find the template in root
extname
Type: String
Default: .html
default suffix name. If there is no suffix, extname is automatically added
htmlmin
Type: Boolean
Default: false
html minifier
data
Type: Object
Default: {}
incoming template data
Usage Examples
template: compile: options: root: 'src/template/' data: v: '1.0.0' files: src: '**/*.html' '!template/**/*.html' dest: 'dist' expand: true cwd: 'src'
html ``js
@% block('title') %@ @% block('head') %@
@% include('./header.art') %@
@% block('js') %@
```
@% block('content') %@
@% include('./footer.art') %@
html minifier
template: compile: options: htmlmin:true
Release History
- 2017-08-20 v2.1.2 require chalk
- 2017-08-19 v2.1.1 add html examples
- 2017-08-19 v2.1.0 add devDependencies and html-minifier
- 2017-08-18 v2.0.2 update template not found error
- 2017-08-18 v2.0.0 delete test folder
- 2017-08-18 v1.0.0