Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

MoLow/grunt-vash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-vash v0.1.0 Build Status: Linux

Compile Vash templates

Getting Started

This plugin requires Grunt >=0.4.0

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-vash --save-dev

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

grunt.loadNpmTasks('grunt-vash');

Vash task

Run this task with the grunt Vash command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

process

Type: Function Default: null

Process the output of a compiled vash template.

model

Type: Object

Sets the model passed to Vash during template compilation. Any data can be passed to the template.

dest

Type: String

Sets the destination where to save compiled vash template.

Usage Examples

vash: {
    compile: {
        files: {
            'test/fixtures/unit.vash': {
                dest: 'tmp/vash.html',
                model: {
                    theme: 'theme1', name: 'fixtures'
                }
            },
        },
        options:{
            process: function(content, path){
                return content.replace(/<!---->/gi, '');
            }
        }
    },
}

if you ar intreastead in multiple destenations for a single vash file:

vash: {
    compile: {
        files: {
            'test/fixtures/unit.vash': {
                'theme1':{
                    dest: 'tmp/vash.html',
                    model: {
                        theme: 'theme1', name: 'fixtures'
                    }
                },
                'theme2':{
                    dest: 'tmp/vash.html',
                    model: {
                        theme: 'theme2', name: 'bob'
                    }
                },
            },
        },
        options:{
            process: function(content, path){
                return content.replace(/<!---->/gi, '');
            }
        }
    },
}

About

Compile Vash templates with grunt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published