This package has been deprecated

Author message:

Package no longer supported. Use at your own risk

malifi-jade

0.1.0 • Public • Published

malifi-jade

Adds Jade template support to Malifi.

Usage: In the metadata template_map_ object for the target MIME type, map file extension(s) to malifi-jade.

For example, to establish template mapping for an entire site, in the site's root directory _default.meta.coffee file:

malifi_jade= require 'malifi-jade'

module.exports=
  template_map_:
    'text/html': [
      ['jade', malifi_jade]
    ]

Remember that Malifi can map file extensions to template engine, so the following map would choose either the Jade or the Underscore template engine, based on file extension:

module.exports=
  template_map_:
    'text/html': [
      ['jade', malifi_jade]
      ['html', malifi_consolidate('underscore')]
    ]

Alternatively, the site-wide mapping of Jade templates could be expressed in Javascript in _default.meta.js as:

(function() {
  var malifi_jade;

  malifi_jade = require('../../../index');

  module.exports = {
    template_map_: {
      'text/html': [
        ['jade', malifi_jade]
      ]
    }
  };

}).call(this);

Of course, the metadata file could define other metadata, and the mapping could be established for any directory or even for individual URLs.

Options

If ext_malifi_jade_options_ is defined in metadata, those options will be passed to Jade's compile function. The filename option will always be set by malifi-jade to the name of the template file.

Readme

Keywords

none

Package Sidebar

Install

npm i malifi-jade

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • randymized