Socket
Socket
Sign inDemoInstall

grunt-contrib-jade

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-jade

Compile Jade files to HTML.


Version published
Weekly downloads
2.1K
decreased by-8.04%
Maintainers
2
Weekly downloads
 
Created
Source

grunt-contrib-jade Build Status

Compile Jade files to HTML (part of the grunt-contrib collection). Submitted by Eric Woroshow.

Overview

Inside your grunt.js file add a section named jade. This section specifies files to compile and the options passed to jade.

Parameters
files object

This defines what files this task will process and should contain key:value pairs.

The key (destination) should be an unique filepath (supports grunt.template) and the value (source) should be a filepath or an array of filepaths (supports minimatch).

Note: When the value contains an array of multiple filepaths, the contents are concatenated in the order passed.

options object

This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.

Options
data object

Sets the data passed to jade during template compilation. Any data can be passed to the template (including grunt templates).

Config Examples
jade: {
  compile: {
    options: {
      data: {
        debug: false
      }
    },
    files: {
      "path/to/dest.html": ["path/to/templates/*.jade", "another/path/tmpl.jade"]
    }
  }
}

If you want to generate a debug file and a release file from the same template:

jade: {
  debug: {
    options: {
      data: {
        debug: true
      }
    },
    files: {
      "debug.html": "test.jade"
    }
  },
  release: {
    options: {
      data: {
        debug: false
      }
    },
    files: {
      "release.html": "test.jade"
    }
  }
}

If you want to use grunt template in options.data:

jade: {
  debug: {
    options: {
      data: {
        debug: true,
        timestamp: "<%= new Date().getTime() %>"
      }
    },
    files: {
      "debug.html": "test.jade"
    }
  }
}

or you can use grunt helpers (grunt object was exposed at template context):

jade: {
  debug: {
    options: {
      data: {
        debug: true,
        timestamp: "<%= grunt.template.today() %>"
      }
    },
    files: {
      "debug.html": "test.jade"
    }
  }
}

Release History

  • 2012/09/24 - v0.3.0 - general cleanup and consolidation. test refactoring. global options depreciated.
  • 2012/09/10 - v0.2.0 - refactored from grunt-contrib into individual repo.

Keywords

FAQs

Package last updated on 24 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc